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.

A322807 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -1 if n is an odd prime, and f(n) = A285330(n) for all other numbers.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 3, 6, 5, 7, 3, 8, 3, 9, 8, 10, 3, 11, 3, 12, 12, 13, 3, 14, 7, 15, 9, 16, 3, 17, 3, 18, 14, 19, 11, 20, 3, 21, 22, 23, 3, 24, 3, 25, 26, 27, 3, 28, 17, 29, 30, 31, 3, 32, 23, 33, 34, 35, 3, 36, 3, 37, 38, 39, 28, 40, 3, 22, 41, 42, 3, 43, 3, 44, 45, 46, 20, 47, 3, 48, 49, 50, 3, 51, 52, 53, 54, 55, 3, 56, 29, 57, 58, 59, 60, 61, 3, 62, 15
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2018

Keywords

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A007947(n) = factorback(factorint(n)[, 1]); \\ From A007947
    A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ From A048675
    A285328(n) = { my(r); if((n > 1 && !bitand(n,(n-1))), (n/2), r=A007947(n); if(r==n,1,n = n-r; while(A007947(n) <> r, n = n-r); n)); };
    A285330(n) = if(issquarefree(n),A048675(n),A285328(n));
    A322807aux(n) = if((n%2)&&isprime(n),-1,A285330(n));
    v322807 = rgs_transform(vector(up_to,n,A322807aux(n)));
    A322807(n) = v322807[n];