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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

1, 7, 34, 358, 4003, 43369, 456712, 4708240, 47754961, 1339156591, 39693785002, 1169411930926, 34213667699203, 995038950807565, 28790341783585180, 829295063367580492, 23793774263808446005, 680307709052882601259, 19390954850541496025998
Offset: 1

Views

Author

N. J. A. Sloane, Feb 17 2023

Keywords

Comments

This has the same relationship to A360505 as A048435 does to A360502.
The primes in A048435 are in A360503. What are the primes in the present sequence?
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

Examples

			A360505(4) = 111021 and 111021_3 = 358_10 = a(4).
		

Crossrefs

Programs

  • PARI
    a(n) = fromdigits(concat([digits(k, 3) | k <- Vecrev([1..n])]), 3) \\ Rémy Sigrist, Feb 18 2023
    
  • Python
    from sympy.ntheory import digits
    def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in range(n, 0, -1)), 3)
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Feb 19 2023
    
  • Python
    # faster version for initial segment of sequence
    from sympy.ntheory import digits
    from itertools import count, islice
    def agen(s=""): yield from (int(s:="".join(map(str, digits(n, 3)[1:]))+s, 3) for n in count(1))
    print(list(islice(agen(), 20))) # Michael S. Branicky, Feb 19 2023
    
  • Python
    from itertools import count, islice
    def A360506_gen(): # generator of terms
        a, b, c = 3, 1, 0
        for i in count(1):
            if i >= a:
                a *= 3
            c += i*b
            yield c
            b *= a
    A360506_list = list(islice(A360506_gen(),30)) # Chai Wah Wu, Nov 08 2023

Formula

a(n) = A028898(A360505(n)). - Rémy Sigrist, Feb 18 2023

Extensions

More terms from Rémy Sigrist, Feb 18 2023
Showing 1-1 of 1 results.