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.

A322810 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = 0 if n is an odd squarefree number > 1, and f(n) = n for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 27 2018

Keywords

Comments

For all i, j:
A305801(i) = A305801(j) => a(i) = a(j),
a(i) = a(j) => A305980(i) = A305980(j),
a(i) = a(j) => A322808(i) = A322808(j).

Crossrefs

Cf. A056911 (after the initial 1, gives the positions of 3's in this sequence).

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; };
    A322810aux(n) = if((n>1)&&(n%2)&&issquarefree(n),0,n);
    v322810 = rgs_transform(vector(up_to,n,A322810aux(n)));
    A322810(n) = v322810[n];

Formula

a(1) = 1, a(2) = 2, for n > 2, if n is an odd squarefree number (in A056911), a(n) = 3, otherwise a(n) = running count from 4 onward.