A079559 prod(n>=1, 1+x^(2^n-1) )

Joerg Arndt arndt at jjj.de
Thu Jul 14 14:20:25 CEST 2005


The funny recursion

void A079559(int f, int n)
{
    int m;
    printf("1,");
    for (m=1; m<n; m*=2)  A079559(f+m, m);
    printf("0,");
}

started with args (0, 2**k) seems to give A079559.
Any explanation why that is?
C program attached. 


-- 
p=2^q-1 prime <== q>2, cosh(2^(q-2)*log(2+sqrt(3)))%p=0
Life is hard and then you die.

-------------- next part --------------

/*
 gcc -W -Wall A079559.c
 for ((k=0;k<=4;++k)); do ./a.out $k; done
 1,0,
 1,1,0,0,
 1,1,0,1,1,0,0,0,
 1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0,
 1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0,0,

pari/gp:
 Vec(prod(n=1,4,(1+x^(2^n-1))))
[1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1]

*/

#include <stdio.h>
#include <stdlib.h>

void A079559(int f, int n)
{
    int m;
    printf("1,");
    for (m=1; m<n; m*=2)  A079559(f+m, m);
    printf("0,");
}

int main(int argc, char **argv)
{
    int n, ldn = 4;
    if ( argc>1 ) ldn = atoi(argv[1]);
    n = 1<<ldn; /* n=2**ldn */
    A079559(0, n);
    printf("\n");
    return 0;
}



More information about the SeqFan mailing list