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.

A112049 a(n) = position of A112046(n) in A000040.

This page as a plain text file.
%I A112049 #27 Mar 13 2021 00:55:51
%S A112049 1,1,2,2,1,1,2,2,1,1,3,3,1,1,2,2,1,1,2,2,1,1,3,4,1,1,2,2,1,1,2,2,1,1,
%T A112049 4,3,1,1,2,2,1,1,2,2,1,1,3,3,1,1,2,2,1,1,2,2,1,1,4,5,1,1,2,2,1,1,2,2,
%U A112049 1,1,3,3,1,1,2,2,1,1,2,2,1,1,3,6,1,1,2,2,1,1,2,2,1,1,4,3,1,1,2,2,1,1
%N A112049 a(n) = position of A112046(n) in A000040.
%C A112049 A112051 gives the first positions of distinct new values in this sequence, that seem also to be the positions of the first occurrence of each n, and thus the positions of the records. Compare also to A084921. - _Antti Karttunen_, May 26 2017
%H A112049 Indranil Ghosh (terms 1..1000) & Antti Karttunen, <a href="/A112049/b112049.txt">Table of n, a(n) for n = 1..32768</a>
%F A112049 a(n) = A049084(A112046(n)).
%t A112049 a112046[n_]:=Block[{i=1},While[JacobiSymbol[i, 2n + 1]==1, i++]; i];a049084[n_]:=If[PrimeQ[n], PrimePi[n], 0]; Table[a049084[a112046[n]], {n, 102}] (* _Indranil Ghosh_, May 11 2017 *)
%o A112049 (PARI) A112049(n) = for(i=1, (2*n), if((kronecker(i, (n+n+1)) < 1), return(primepi(i)))); \\ _Antti Karttunen_, May 26 2017
%o A112049 (Python)
%o A112049 from sympy import jacobi_symbol as J, isprime, primepi
%o A112049 def a049084(n):
%o A112049     return primepi(n) if isprime(n) else 0
%o A112049 def a112046(n):
%o A112049     i=1
%o A112049     while True:
%o A112049         if J(i, 2*n + 1)!=1: return i
%o A112049         else: i+=1
%o A112049 def a(n): return a049084(a112046(n))
%o A112049 print([a(n) for n in range(1, 103)]) # _Indranil Ghosh_, May 11 2017
%Y A112049 Cf. A049084, A112046, A112051, A112060, A165471, A268829, A286465, A286466.
%Y A112049 Cf. A286579 (ordinal transform).
%K A112049 nonn
%O A112049 1,3
%A A112049 _Antti Karttunen_, Aug 27 2005
%E A112049 Unnecessary fallback-clause removed from the name by _Antti Karttunen_, May 26 2017