login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A323074 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -(n mod 4) if n is a prime, and f(n) = A300840(n) for any other number. 2

%I #6 Jan 04 2019 17:37:05

%S 1,2,3,4,5,6,3,4,7,8,3,9,5,10,11,12,5,7,3,13,14,15,3,9,16,17,18,19,5,

%T 11,3,12,20,21,22,23,5,24,25,13,5,14,3,26,27,28,3,29,30,16,31,32,5,18,

%U 33,19,34,35,3,36,5,37,38,39,40,20,3,41,42,22,3,23,5,43,44,45,46,25,3,47,48,49,3,50,51,52,53,26,5,27,54,55,56,57,58,29,5,30,59,60,5,31,3,32

%N Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -(n mod 4) if n is a prime, and f(n) = A300840(n) for any other number.

%C For all i, j:

%C A319704(i) = A319704(j) => a(i) = a(j) => A323082(i) = A323082(j).

%H Antti Karttunen, <a href="/A323074/b323074.txt">Table of n, a(n) for n = 1..65539</a>

%o (PARI)

%o up_to = 65539;

%o 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; };

%o ispow2(n) = (n && !bitand(n,n-1));

%o A302777(n) = ispow2(isprimepower(n));

%o A050376list(up_to) = { my(v=vector(up_to), i=0); for(n=1,oo,if(A302777(n), i++; v[i] = n); if(i == up_to,return(v))); };

%o v050376 = A050376list(up_to);

%o A050376(n) = v050376[n];

%o A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };

%o A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&A302777(n/d), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };

%o A300840(n) = A052330(A052331(n)>>1);

%o A323074aux(n) = if(isprime(n),-(n%4),A300840(n));

%o v323074 = rgs_transform(vector(up_to,n,A323074aux(n)));

%o A323074(n) = v323074[n];

%Y Cf. A052330, A300840, A319704, A323081, A323082.

%K nonn

%O 1,2

%A _Antti Karttunen_, Jan 04 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 15 03:44 EDT 2024. Contains 375931 sequences. (Running on oeis4.)