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.

A302051 An analog of A000005 for nonstandard factorization based on the sieve of Eratosthenes (A083221).

This page as a plain text file.
%I A302051 #11 Apr 03 2018 15:10:53
%S A302051 1,2,2,3,2,4,2,4,3,4,2,6,2,4,4,5,2,6,2,6,4,4,2,8,3,4,4,6,2,8,2,6,6,4,
%T A302051 4,9,2,4,4,8,2,8,2,6,5,4,2,10,3,6,6,6,2,8,4,8,6,4,2,12,2,4,4,7,4,12,2,
%U A302051 6,8,8,2,12,2,4,4,6,4,8,2,10,6,4,2,12,6,4,8,8,2,10,4,6,6,4,4,12,2,6,4,9,2,12,2,8,9
%N A302051 An analog of A000005 for nonstandard factorization based on the sieve of Eratosthenes (A083221).
%C A302051 See A302042, A302044 and A302045 for a description of the factorization process.
%H A302051 Antti Karttunen, <a href="/A302051/b302051.txt">Table of n, a(n) for n = 1..65537</a>
%H A302051 <a href="/index/Si#sieve">Index entries for sequences generated by sieves</a>
%F A302051 a(1) = 1, for n > 1, a(n) = (A302045(n)+1) * a(A302044(n)).
%F A302051 a(n) = A000005(A250246(n)).
%F A302051 a(n) = A106737(A252754(n)).
%o A302051 (PARI)
%o A302051 up_to = 65537;
%o A302051 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 A302051 A020639(n) = if(n>1, if(n>n=factor(n, 0)[1, 1], n, factor(n)[1, 1]), 1); \\ From A020639
%o A302051 v078898 = ordinal_transform(vector(up_to,n,A020639(n)));
%o A302051 A078898(n) = v078898[n];
%o A302051 A000265(n) = (n/2^valuation(n, 2));
%o A302051 A001511(n) = 1+valuation(n,2);
%o A302051 A302045(n) = A001511(A078898(n));
%o A302051 A302044(n) = { my(c = A000265(A078898(n))); if(1==c,1,my(p = prime(-1+primepi(A020639(n))+primepi(A020639(c))), d = A078898(c), k=0); while(d, k++; if((1==k)||(A020639(k)>=p),d -= 1)); (k*p)); };
%o A302051 A302051(n) = if(1==n,n,(A302045(n)+1)*A302051(A302044(n)));
%o A302051 (PARI)
%o A302051 \\ Or, using also some of the code from above:
%o A302051 A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
%o A302051 A055396(n) = if(1==n,0,primepi(A020639(n)));
%o A302051 A250246(n) = if(1==n,n,my(k = 2*A250246(A078898(n)), r = A055396(n)); if(1==r, k, while(r>1, k = A003961(k); r--); (k)));
%o A302051 A302051(n) = numdiv(A250246(n));
%Y A302051 Cf. A000005, A083221, A302042, A302044, A302045, A302052 (reduced modulo 2), A302053 (gives the positions of odd numbers).
%Y A302051 Cf. also A253557, A302041, A302050, A302052, A302039, A302055 for other similar analogs.
%K A302051 nonn
%O A302051 1,2
%A A302051 _Antti Karttunen_, Apr 01 2018