login
Write primes in base 10 but interpret as if in base 11.
3

%I #19 Sep 01 2024 18:31:44

%S 2,3,5,7,12,14,18,20,25,31,34,40,45,47,51,58,64,67,73,78,80,86,91,97,

%T 106,122,124,128,130,135,150,155,161,163,174,177,183,190,194,201,207,

%U 210,221,223,227,229,254,267,271,273,278,284,287,298,304,311

%N Write primes in base 10 but interpret as if in base 11.

%H Alois P. Heinz, <a href="/A031216/b031216.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A171397(prime(n)). - _Michel Marcus_, Aug 31 2024

%e 13_10 = 11+2 -> 12_11, so 5th term is 12.

%p a:= n-> (l-> add(l[i]*11^(i-1), i=1..nops(l)))(convert(ithprime(n),base,10)):

%p seq(a(n), n=1..56); # _Alois P. Heinz_, Aug 30 2024

%o (Python)

%o from sympy import prime

%o def A031216(n): return int(str(prime(n)),11) # _Chai Wah Wu_, Aug 30 2024

%o (PARI) a(n) = fromdigits(digits(prime(n)), 11); \\ _Michel Marcus_, Aug 31 2024

%Y Cf. A000040, A171397.

%K nonn,base

%O 1,1

%A _Jeff Burch_

%E a(25) corrected by _Sean A. Irvine_, Apr 16 2020