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-7 of 7 results.

A230004 Numbers n such that phi(n) + sigma(n) = reversal(n) + 4.

Original entry on oeis.org

499, 2836, 4999, 49999, 280036, 4999999, 28000036, 283682836, 2800000000036
Offset: 1

Views

Author

Farideh Firoozbakht, Nov 07 2013

Keywords

Comments

If p=5*10^m-1 is prime (m is a term of A056712) then p is in the sequence.
Let p(m,n) = 10^(m+3)*(7*10^(m+2)+92)*(10^((m+4)*n)-1)/(10^(m+4)-1) +7*10^(m+1)+9, if m>0, n>=0 and p(m,n) is prime then 4*p(m,n) is in the sequence.
All known terms are of these two forms.
What is the smallest term of the sequence which is not of the form p or 4*p where p is prime?
Note that a(2)=4*p(1,0), a(5)=4*p(3,0), a(7)=4*p(5,0) and a(8)=4*p(1,1).

Examples

			phi(499)+sigma(499) = 498+500 = 994+4 = reversal(499)+4, so 499 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    r[n_] := FromDigits[Reverse[IntegerDigits[n]]]; Do[If[DivisorSigma[1,n] + EulerPhi[n] == r[n] + 4, Print[n]], {n,1050000000}]
    Select[Range[5*10^6],EulerPhi[#]+DivisorSigma[1,#]==IntegerReverse[#]+4&] (* The program generates the first 6 terms of the sequence. *) (* Harvey P. Dale, Dec 28 2024 *)
  • PARI
    is(n)=subst(Polrev(digits(n)),'x,10)+4==eulerphi(n)+sigma(n) \\ Charles R Greathouse IV, Nov 08 2013

Extensions

a(9) from Giovanni Resta, Feb 06 2014

A372308 Composite numbers k such that the digits of k are in nonincreasing order while the digits of the concatenation of k's ascending order prime factors, with repetition, are in nondecreasing order.

Original entry on oeis.org

4, 6, 8, 9, 10, 20, 21, 30, 32, 40, 42, 50, 54, 60, 63, 64, 70, 72, 74, 75, 80, 81, 84, 90, 92, 94, 96, 98, 100, 111, 200, 210, 222, 300, 320, 333, 400, 420, 432, 441, 444, 500, 531, 540, 553, 554, 600, 611, 630, 632, 640, 666, 700, 711, 720, 750, 752, 800, 810, 840, 851, 864, 871, 875, 882
Offset: 1

Views

Author

Scott R. Shannon, Apr 26 2024

Keywords

Comments

As all the numbers 10,20,...,90,100 are terms, all numbers that are recursively 10 times these values are also terms as they just add an additional 2 and 5 to their parent's prime factor list.
A number 999...9998 will be a term if it has two prime factors 2 and 4999...999. Therefore 999999999999998 and 999...9998 (with 54 9's) are both terms. See A056712.

Examples

			42 is a term as 42 = 2 * 3 * 7, and 42 has nonincreasing digits while its prime factor concatenation "237" has nondecreasing digits.
		

Crossrefs

Programs

  • Python
    from sympy import factorint, isprime
    from itertools import count, islice, combinations_with_replacement as mc
    def nd(s): return s == "".join(sorted(s))
    def bgen(d):
        yield from ("".join(m) for m in mc("9876543210", d) if m[0]!="0")
    def agen(): # generator of terms
        for d in count(1):
            out = set()
            for s in bgen(d):
                t = int(s)
                if t < 4 or isprime(t): continue
                if nd("".join(str(p)*e for p,e in factorint(t).items())):
                    out.add(t)
            yield from sorted(out)
    print(list(islice(agen(), 65))) # Michael S. Branicky, Apr 26 2024

A372295 Composite numbers k such that k's prime factors are distinct, the digits of k are in nonincreasing order while the digits of the concatenation of k's ascending order prime factors are in nondecreasing order.

Original entry on oeis.org

6, 10, 21, 30, 42, 70, 74, 94, 111, 210, 222, 553, 554, 611, 851, 871, 885, 998, 5530, 5554, 7751, 8441, 8655, 9998, 85511, 95554, 99998, 9999998, 77744411, 5555555554, 7777752221, 8666666655, 755555555554, 95555555555554, 999999999999998, 5555555555555554, 8666666666666655, 755555555555555554
Offset: 1

Views

Author

Scott R. Shannon, Apr 25 2024

Keywords

Comments

A number 999...9998 will be a term if it has two prime factors 2 and 4999...999. Therefore 999999999999998 and 999...9998 (with 54 9's) are both terms. See A056712.
The next term is greater than 10^11.

Examples

			77744411 is a term as 77744411 = 233 * 333667 which has distinct prime factors, 77744411 has nonincreasing digits while its prime factor concatenation "233333667" has nondecreasing digits.
		

Crossrefs

Programs

  • Python
    from sympy import factorint, isprime
    from itertools import count, islice, combinations_with_replacement as mc
    def nd(s): return s == "".join(sorted(s))
    def bgen(d):
        yield from ("".join(m) for m in mc("9876543210", d) if m[0]!="0")
    def agen(): # generator of terms
        for d in count(1):
            out = set()
            for s in bgen(d):
                t = int(s)
                if t < 4 or isprime(t): continue
                f = factorint(t)
                if len(f) < sum(f.values()): continue
                if nd("".join(str(p) for p in f)):
                    out.add(t)
            yield from sorted(out)
    print(list(islice(agen(), 29))) # Michael S. Branicky, Apr 26 2024

Extensions

a(33)-a(38) from Michael S. Branicky, Apr 26 2024

A093945 Primes of the form 5*10^n - 1.

Original entry on oeis.org

499, 4999, 49999, 4999999, 499999999999999, 4999999999999999999999999999999999999999999999999999999
Offset: 1

Views

Author

Rick L. Shepherd, Apr 17 2004

Keywords

Comments

Equivalently, primes of the form 4*10^n + 9*R_n, where R_n is the repunit (A002275) of length n.
If m is in the sequence then m appears at the end of m^3, in fact if n>1 and m=5*10^n-1 then m appears at the end of m^3. - Farideh Firoozbakht, Nov 10 2005
If n is in the sequence then 4n is a term of A067206. Namely the digits of 4n end in phi(4n) - the proof is easy. - Farideh Firoozbakht, Dec 30 2006
The next term -- a(7) -- has 211 digits. - Harvey P. Dale, Feb 20 2016

Crossrefs

Cf. A056712 (corresponding n).
Cf. A067206.

Programs

  • Mathematica
    Select[Table[FromDigits[PadRight[{4},n,9]],{n,60}],PrimeQ] (* Harvey P. Dale, Feb 20 2016 *)

A372046 Composite numbers that divide the concatenation of the reverse of their ascending order prime factors, with repetition.

Original entry on oeis.org

998, 1636, 9998, 15584, 49447, 99998, 1639964, 2794612, 9999998, 15842836, 1639360636, 1968390098, 27879461212, 65226742928
Offset: 1

Views

Author

Scott R. Shannon, Apr 17 2024

Keywords

Comments

A number 999...9998 will be a term if it has two prime factors 2 and 4999...999. Therefore 999999999999998 and 999...9998 (with 54 9's) are both terms. See A056712.
100000000000 < a(15) <= 999999999999998. Robert P. P. McKone, May 07 2024

Examples

			998 is a term as 998 = 2 * 499 = "2" * "994" when each prime factor is reversed. This gives "2994", and 2994 is divisible by 998.
15584 is a term as 15584 = 2 * 2 * 2 * 2 * 2 * 487 = "2" * "2" * "2" * "2" * "2" * "784" when each prime factor is reversed. This gives "22222784", and 22222784 is divisible by 15584.
		

Crossrefs

Programs

  • Mathematica
    a[n_Integer] := Module[{f}, f = Flatten[ConstantArray @@@ FactorInteger[n]]; If[Length[f] < 2, Return[False]]; Mod[FromDigits[StringJoin[StringReverse[IntegerString[#, 10]] & /@ f], 10], n] == 0];
    Select[Range[2, 10^5], a] (* Robert P. P. McKone, May 03 2024 *)
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A372046_gen(startvalue=4): # generator of terms >= startvalue
        for n in count(max(startvalue,4)):
            f = factorint(n)
            if sum(f.values()) > 1:
                c = 0
                for p in sorted(f):
                    a = pow(10,len(s:=str(p)),n)
                    q = int(s[::-1])
                    for _ in range(f[p]):
                        c = (c*a+q)%n
                if not c:
                    yield n
    A372046_list = list(islice(A372046_gen(),5)) # Chai Wah Wu, Apr 24 2024

Extensions

a(13)-a(14) from Robert P. P. McKone, May 05 2024

A129990 Primes p such that the smallest integer whose sum of decimal digits is p is prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 19, 23, 29, 31, 41, 43, 71, 79, 97, 173, 179, 257, 269, 311, 389, 691, 4957, 8423, 11801, 14621, 25621, 26951, 38993, 75743, 102031, 191671, 668869
Offset: 1

Views

Author

J. M. Bergot, Jun 14 2007

Keywords

Examples

			The smallest integer whose sum of digits is 17 is 89; 89 is prime, therefore 17 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[1000]],PrimeQ[FromDigits[Join[{Mod[ #,9]},Table[9,{i,1,Floor[ #/9]}]]]] &]
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def A051885(n): return ((n%9)+1)*10**(n//9)-1 # from Chai Wah Wu
    def agen(startp=2):
        p = startp
        while True:
            if isprime(A051885(p)): yield p
            p = nextprime(p)
    print(list(islice(agen(), 23))) # Michael S. Branicky, Jul 27 2022
    
  • Sage
    sorted( filter(is_prime, sum(([9*t+k for t in oeis(seq).first_terms()] for seq,k in (('A002957',1), ('A056703',2), ('A056712',4), ('A056716',5), ('A056721',7), ('A056725',8))), [3])) ) # Max Alekseyev, Feb 05 2025

Formula

Primes p such that (p mod 9 + 1) * 10^[p/9] - 1 is prime. Therefore the sequence consists of the term 3 and the primes of the forms A002957(k)*9+1, A056703(k)*9+2, A056712(k)*9+4, A056716(k)*9+5, A056721(k)*9+7, A056725(k)*9+8. - Max Alekseyev, Nov 09 2009

Extensions

Edited, corrected and extended by Stefan Steinerberger, Jun 23 2007
Extended by D. S. McNeil, Mar 20 2009
a(29)-a(33) from Max Alekseyev, Nov 09 2009

A295988 Numbers k such that (10^k)/2 - 1 is prime.

Original entry on oeis.org

3, 4, 5, 7, 15, 55, 211, 391, 595, 3461, 5029, 5220, 5333, 8073, 15797, 16132, 21457, 29283, 78791, 85143, 179973, 211030, 445774, 464844, 511057
Offset: 1

Views

Author

Patrick A. Thomas, Dec 02 2017

Keywords

Examples

			499, 4999, 49999, 4999999 are prime, while 4, 49, 499999, 49999999 are composite.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^3], PrimeQ[10^#/2 - 1] &] (* Michael De Vlieger, Dec 02 2017 *)
  • PARI
    isok(n) = isprime(10^n/2 - 1); \\ Michel Marcus, Dec 02 2017

Formula

a(n) = 1 + A056712(n). - Omar E. Pol, Dec 02 2017

Extensions

a(7)-a(25) from Michel Marcus and Omar E. Pol, Dec 02 2017
Showing 1-7 of 7 results.