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.

A077724 a(n) = smallest prime which can be expressed as a sum of distinct powers of n.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 73, 739, 11, 11, 13, 13, 197, 241, 17, 17, 19, 19, 401, 463, 23, 23, 577, 10171901, 677, 757, 29, 29, 31, 31, 32801, 1123, 1336337, 44101, 37, 37, 1483, 59359, 41, 41, 43, 43, 85229, 93151, 47, 47, 110641, 13847169701, 2551, 345157903, 53, 53
Offset: 2

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

a(n) = smallest prime whose base n representation contains only zeros and 1's.
Values of n at which a(n) reach record values are: 2, 3, 4, 6, 8, 9, 25, 49, 91, 121, 187, 201, 301, 721, 799, 841... Notably, many of them are squares of primes. - Ivan Neretin, Sep 20 2017

Crossrefs

Programs

  • Mathematica
    Table[i = p = 1; While[! PrimeQ[p], p = FromDigits[IntegerDigits[i++, 2], n]]; p, {n, 2, 53}] (* Ivan Neretin, Sep 20 2017 *)
  • Python
    from itertools import count
    from sympy import isprime
    def A077724(n): return next(filter(isprime,(sum(n**i for i, j in enumerate(bin(m)[-1:1:-1]) if j=='1') for m in count(1)))) # Chai Wah Wu, Apr 04 2025

Extensions

More terms from Sascha Kurz, Jan 03 2003