cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A286614 Restricted growth sequence transform of A286613.

Original entry on oeis.org

1, 2, 2, 2, 3, 4, 2, 5, 5, 2, 6, 2, 3, 5, 6, 2, 2, 2, 6, 7, 5, 2, 8, 6, 2, 5, 5, 2, 6, 6, 2, 5, 3, 6, 5, 6, 5, 2, 9, 5, 10, 6, 2, 5, 11, 2, 9, 5, 5, 9, 5, 5, 8, 12, 2, 6, 13, 5, 14, 2, 2, 9, 5, 5, 5, 5, 2, 2, 13, 6, 2, 2, 5, 2, 13, 8, 5, 5, 12, 6, 5, 5, 5, 2, 5, 6, 6, 5, 2, 2, 6, 6, 9, 5, 6, 15, 5, 5, 6, 5
Offset: 0

Views

Author

Antti Karttunen, May 30 2017

Keywords

Crossrefs

Programs

  • PARI
    rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ This function from Michel Marcus
    A048673(n) = (A003961(n)+1)/2;
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of M. F. Hasler
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    A286613(n) = A046523(A048673(A005940(1+n)));
    write_to_bfile(0,rgs_transform(vector(65537,n,A286613(n-1))),"b286614.txt");