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.

A305300 Ordinal transform of A305430, the smallest k > n whose binary expansion encodes an irreducible (0,1)-polynomial over Q.

This page as a plain text file.
%I A305300 #15 Dec 20 2021 09:49:17
%S A305300 1,1,1,2,1,2,1,2,3,4,1,2,1,2,3,4,1,2,1,2,3,4,1,2,1,2,3,4,1,2,1,2,3,4,
%T A305300 5,6,1,2,3,4,1,2,1,2,3,4,1,2,3,4,5,6,1,2,1,2,3,4,1,2,1,2,3,4,5,6,1,2,
%U A305300 1,2,1,2,1,2,3,4,1,2,1,2,1,2,1,2,3,4,1,2,1,2,1,2,3,4,5,6,1,2,3,4,1,2,1,2,3
%N A305300 Ordinal transform of A305430, the smallest k > n whose binary expansion encodes an irreducible (0,1)-polynomial over Q.
%H A305300 Antti Karttunen, <a href="/A305300/b305300.txt">Table of n, a(n) for n = 1..65537</a>
%F A305300 a(1) = 1; for n > 1, if A257000(n) = 1 [when n is in A206074], a(n) = 1, otherwise a(n) = 1 + n - A305429(n).
%t A305300 binPol[n_, x_] := With[{bb = IntegerDigits[n, 2]}, bb.x^Range[Length[bb]-1, 0, -1]];
%t A305300 ip[n_] := If[IrreduciblePolynomialQ[binPol[n, x]], 1, 0];
%t A305300 A305430[n_] := Module[{k = n + 1}, While[ip[k] == 0, k++]; k];
%t A305300 b[_] = 0;
%t A305300 a[n_] := a[n] = With[{t = A305430[n]}, b[t] = b[t]+1];
%t A305300 Array[a, 105] (* _Jean-François Alcover_, Dec 20 2021 *)
%o A305300 (PARI)
%o A305300 A257000(n) = polisirreducible(Pol(binary(n)));
%o A305300 A305429(n) = if(n<3,1, my(k=n-1); while(k>1 && !A257000(k),k--); (k));
%o A305300 A305300(n) = if((1==n)||(1==A257000(n)),1,1+(n-A305429(n)));
%o A305300 (PARI)
%o A305300 up_to = 65537;
%o A305300 ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
%o A305300 A305430(n) = { my(k=1+n); while(!A257000(k),k++); (k); };
%o A305300 v305300 = ordinal_transform(vector(up_to,n,A305430(n)));
%o A305300 A305300(n) = v305300[n];
%Y A305300 Cf. A206074 (gives the positions of other 1's after the initial one).
%Y A305300 Cf. A257000, A305429, A305430, A305437, A305438.
%Y A305300 Cf. also A175851.
%K A305300 nonn
%O A305300 1,4
%A A305300 _Antti Karttunen_, Jun 09 2018