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.

A360506 Read A360505(n) as if it were a base-3 string and write it in base 10.

This page as a plain text file.
%I A360506 #29 Nov 09 2023 08:54:48
%S A360506 1,7,34,358,4003,43369,456712,4708240,47754961,1339156591,39693785002,
%T A360506 1169411930926,34213667699203,995038950807565,28790341783585180,
%U A360506 829295063367580492,23793774263808446005,680307709052882601259,19390954850541496025998
%N A360506 Read A360505(n) as if it were a base-3 string and write it in base 10.
%C A360506 This has the same relationship to A360505 as A048435 does to A360502.
%C A360506 The primes in A048435 are in A360503. What are the primes in the present sequence?
%C A360506 Answer: The first primes are a(2) = 7, a(5) = 4003, a(13) = 34213667699203, a(57) and a(109). See A360507. - _Rémy Sigrist_, Feb 18 2023
%H A360506 Winston de Greef, <a href="/A360506/b360506.txt">Table of n, a(n) for n = 1..407</a>
%H A360506 <a href="/index/Mo#MWP">Index entries for sequences related to Most Wanted Primes video</a>
%F A360506 a(n) = A028898(A360505(n)). - _Rémy Sigrist_, Feb 18 2023
%e A360506 A360505(4) = 111021 and 111021_3 = 358_10 = a(4).
%o A360506 (PARI) a(n) = fromdigits(concat([digits(k, 3) | k <- Vecrev([1..n])]), 3) \\ _Rémy Sigrist_, Feb 18 2023
%o A360506 (Python)
%o A360506 from sympy.ntheory import digits
%o A360506 def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in range(n, 0, -1)), 3)
%o A360506 print([a(n) for n in range(1, 21)]) # _Michael S. Branicky_, Feb 19 2023
%o A360506 (Python) # faster version for initial segment of sequence
%o A360506 from sympy.ntheory import digits
%o A360506 from itertools import count, islice
%o A360506 def agen(s=""): yield from (int(s:="".join(map(str, digits(n, 3)[1:]))+s, 3) for n in count(1))
%o A360506 print(list(islice(agen(), 20))) # _Michael S. Branicky_, Feb 19 2023
%o A360506 (Python)
%o A360506 from itertools import count, islice
%o A360506 def A360506_gen(): # generator of terms
%o A360506     a, b, c = 3, 1, 0
%o A360506     for i in count(1):
%o A360506         if i >= a:
%o A360506             a *= 3
%o A360506         c += i*b
%o A360506         yield c
%o A360506         b *= a
%o A360506 A360506_list = list(islice(A360506_gen(),30)) # _Chai Wah Wu_, Nov 08 2023
%Y A360506 Cf. A048435, A028898, A360502, A360503, A360505, A360507.
%K A360506 nonn,base
%O A360506 1,2
%A A360506 _N. J. A. Sloane_, Feb 17 2023
%E A360506 More terms from _Rémy Sigrist_, Feb 18 2023