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.
%I A108348 #19 Nov 22 2022 15:44:29 %S A108348 1,3,4,6,7,8,12,13,14,15,18,20,24,30,31,32,38,40,42,44,48,54,57,60,62, %T A108348 63,68,72,74,80,84,90,98,102,104,108,110,114,121,127,128,132,133,138, %U A108348 140,150,152,156,158,164,168,174,180,182,183,192,194,198,200 %N A108348 Numbers of the form p^k + p^(k-1) + ... + p + 1 (where p is a prime and k>=0) in ascending order. %C A108348 A proper subset of A002191 (e.g., 28 is in A002191, but not in this sequence). a(15)=31 admits two representations: 31=2^4+2^3+2^2+2+1=5^2+5+1. Are there other numbers with two or more representation? %C A108348 I have checked all the sums of primes up to prime number 56873 to a sum total >= 10^100 and have not come across another number that has multiple representations. - Patrick Schutte (patrick(AT)onyxsa.co.za), Mar 28 2007 %C A108348 Goormaghtigh conjecture implies that 31 is the only term with 2 representations; see the Wikipedia link below. - _Jianing Song_, Nov 22 2022 %H A108348 M. F. Hasler, <a href="/A108348/b108348.txt">Table of n, a(n) for n = 1..1000</a> %H A108348 Wikipedia, <a href="https://en.wikipedia.org/wiki/Goormaghtigh_conjecture">Goormaghtigh conjecture</a> %e A108348 a(2)=3=2+1 since a(1)=1 and 2 is not expressible in the required form. %o A108348 (PARI) A108348(n)={ local(m=1, a=[m]); while( #a<n, m++; forprime(p=2,m, if( m%p==1 && m*(p-1)==p^round(log(m*(p-1))/log(p))-1, a=concat(a,m);next(2)) ));a }; a=A108348(1000) \\ _M. F. Hasler_ %o A108348 (GAP) SumNum := function ( FNum) local a,ap,b,bp,at,bt; a := 2; repeat at := 1; ap := 1; repeat at := at + a^ap; b := 2; repeat bt := 1; bp := 1; repeat bt := bt + b^bp; if at = bt and bp > 1 and a <> b then Print("a ",a," ap ",ap," at ", at," "); Print("b ",b," bp ",bp," bt ", bt," "); Print("---------------- "); fi; bp := bp + 1; until bt > at; b := NextPrime(b); until b >=a; ap := ap + 1; until at > 10^100; a := NextPrime(a); until a >FNum; end; # Patrick Schutte (patrick(AT)onyxsa.co.za), Mar 28 2007 %o A108348 (Haskell) %o A108348 a108348 n = a108348_list !! (n-1) %o A108348 a108348_list = 1 : f [2..] where %o A108348 f (x:xs) = g a000040_list where %o A108348 g (p:ps) = h 0 $ map ((`div` (p - 1)) . subtract 1) $ %o A108348 iterate (* p) (p ^ 2) where %o A108348 h i (pp:pps) | pp > x = if i == 0 then f xs else g ps %o A108348 | pp < x = h 1 pps %o A108348 | otherwise = x : f xs %o A108348 -- _Reinhard Zumkeller_, Nov 26 2013 %Y A108348 Cf. A002191. %Y A108348 Cf. A000040, A090503. %K A108348 nonn %O A108348 1,2 %A A108348 _Franz Vrabec_, Jul 01 2005