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.

A322822 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(2) = -1, f(n) = 0 if n is a Fermi-Dirac prime (A050376) > 2, and f(n) = A300840(n) for all other numbers.

This page as a plain text file.
%I A322822 #9 Dec 30 2018 07:55:26
%S A322822 1,2,3,3,3,4,3,5,3,6,3,7,3,8,9,3,3,10,3,11,12,13,3,7,3,14,15,16,3,9,3,
%T A322822 17,18,19,20,21,3,22,23,11,3,12,3,24,25,26,3,27,3,28,29,30,3,15,31,16,
%U A322822 32,33,3,34,3,35,36,37,38,18,3,39,40,20,3,21,3,41,42,43,44,23,3,45,3,46,3,47,48,49,50,24,3,25,51,52,53,54,55,27,3,56,57,58,3,29,3,30
%N A322822 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(2) = -1, f(n) = 0 if n is a Fermi-Dirac prime (A050376) > 2, and f(n) = A300840(n) for all other numbers.
%C A322822 For all i, j: a(i) = a(j) => A322823(i) = A322823(j).
%H A322822 Antti Karttunen, <a href="/A322822/b322822.txt">Table of n, a(n) for n = 1..65537</a>
%o A322822 (PARI)
%o A322822 up_to = 65537;
%o A322822 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 A322822 ispow2(n) = (n && !bitand(n,n-1));
%o A322822 A302777(n) = ispow2(isprimepower(n));
%o A322822 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 A322822 v050376 = A050376list(up_to);
%o A322822 A050376(n) = v050376[n];
%o A322822 A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
%o A322822 A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&ispow2(isprimepower(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 A322822 A300840(n) = A052330(A052331(n)>>1);
%o A322822 A322822aux(n) = if((2==n),-1,if(A302777(n),0,A300840(n)));
%o A322822 v322822 = rgs_transform(vector(up_to,n,A322822aux(n)));
%o A322822 A322822(n) = v322822[n];
%Y A322822 Cf. A050376, A052330, A052331, A302777, A300840, A322823.
%Y A322822 Cf. also A322805, A322807.
%K A322822 nonn
%O A322822 1,2
%A A322822 _Antti Karttunen_, Dec 29 2018