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

A054265 Sum of composite numbers between successive primes.

Original entry on oeis.org

0, 4, 6, 27, 12, 45, 18, 63, 130, 30, 170, 117, 42, 135, 250, 280, 60, 320, 207, 72, 380, 243, 430, 651, 297, 102, 315, 108, 333, 1560, 387, 670, 138, 1296, 150, 770, 800, 495, 850, 880, 180, 1674, 192, 585, 198, 2255, 2387, 675, 228, 693, 1180, 240, 2214, 1270
Offset: 1

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Examples

			Between 7 and 11 we have 8 + 9 + 10 which is a(4)=27.
		

Crossrefs

Programs

  • PARI
    a(n) = (prime(n+1) + prime(n))*(prime(n+1) - prime(n) - 1)/2; \\ Michel Marcus, Mar 24 2016
    
  • Python
    from sympy import nextprime, prime
    def A054265(n): return ((p:=prime(n))+(q:=nextprime(p)))*(q-p-1)>>1 # Chai Wah Wu, Jun 01 2024

Formula

a(n) = (prime(n+1) + prime(n))*(prime(n+1) - prime(n) - 1)/2. - Zak Seidov, Sep 12 2002

A054264 Concatenation of composite numbers between the n-th prime and the following prime.

Original entry on oeis.org

4, 6, 8910, 12, 141516, 18, 202122, 2425262728, 30, 3233343536, 383940, 42, 444546, 4849505152, 5455565758, 60, 6263646566, 686970, 72, 7475767778, 808182, 8485868788, 90919293949596, 9899100, 102, 104105106, 108, 110111112
Offset: 2

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Crossrefs

Programs

  • Mathematica
    FromDigits[Flatten[IntegerDigits/@(Range[#[[1]]+1,#[[2]]-1])]]&/@Partition[ Prime[Range[2,30]],2,1] (* Harvey P. Dale, Mar 04 2014 *)
  • PARI
    a(n)=my(r=prime(n)+1); fromdigits(concat(vector(nextprime(r)-r, i, digits(r+i-1)))) \\ Andrew Howroyd, Aug 14 2024

Extensions

Offset changed and name edited by Andrew Howroyd, Aug 14 2024

A054266 Sum of composite numbers between prime p and nextprime(p) is palindromic.

Original entry on oeis.org

3, 5, 109, 193, 281, 509, 661, 827, 857, 1439, 2111, 3433, 3889, 3967, 4549, 6661, 7001, 8467, 10099, 17203, 18583, 21011, 21611, 23831, 24847, 25117, 26261, 26497, 26861, 28181, 29587, 30497, 31307, 47569, 47869, 49789, 53939, 54139, 66361
Offset: 1

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Examples

			a(4)=193 since between 193 and next prime 197 we get the palindromic sum 194 + 195 + 196 = 585.
		

Crossrefs

Programs

  • Mathematica
    okQ[l_]:=Module[{x=IntegerDigits[Total[Range[First[l]+1, Last[l]-1]]]},x==Reverse[x]];Transpose[Select[Partition[ Prime[Range[2,6700]],2,1],okQ]][[1]] (* Harvey P. Dale, Mar 18 2011 *)

Extensions

Corrected and extended b-file by Chai Wah Wu, Feb 25 2018

A104388 Lesser of two successive primes the average of which is a repdigit.

Original entry on oeis.org

3, 5, 7, 97, 109, 4441, 111111109, 555555555551, 9999999999999937, 111111111111111091, 444444444444444419, 555555555555555555491, 777777777777777777777767, 333333333333333333333333333333293, 444444444444444444444444444444444391
Offset: 1

Views

Author

Zak Seidov, Mar 04 2005

Keywords

Crossrefs

Cf. A054268, A104386, A104387 (larger primes), A104389 (repdigits).

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, prevprime
    def agen():
        for d in count(1):
            ru = int("1"*d)
            for r in range(ru, 10*ru, ru):
                if r > 2:
                    p = prevprime(r)
                    if isprime(r + (r-p)) and prevprime(r+(r-p)) == p:
                        yield p
    print(list(islice(agen(), 15))) # Michael S. Branicky, Jun 30 2022

Formula

a(n) = prime(A104386(n)).

Extensions

More terms from Giovanni Resta, Feb 09 2006

A054267 Sum of composite numbers between prime p and nextprime(p) is palindromic with restriction 'p + 1 <> sum'.

Original entry on oeis.org

109, 193, 509, 661, 1439, 3433, 3889, 3967, 4549, 6661, 7001, 8467, 10099, 17203, 18583, 24847, 25117, 26497, 29587, 30497, 31307, 47569, 47869, 49789, 53939, 54139, 66361, 67061, 70901, 71011, 102199, 132229, 158269, 171179, 185699
Offset: 0

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Examples

			a(4)=661 since between 661 and next prime 673 we get the palindromic sum 662 + 663 + 664 + 665 + 666 + 667 + 668 + 669 + 670 + 671 + 672 = 7337.
		

Crossrefs

A104387 Larger of two successive primes the average of which is a repdigit.

Original entry on oeis.org

5, 7, 11, 101, 113, 4447, 111111113, 555555555559, 10000000000000061, 111111111111111131, 444444444444444469, 555555555555555555619, 777777777777777777777787, 333333333333333333333333333333373, 444444444444444444444444444444444497
Offset: 1

Views

Author

Zak Seidov, Mar 04 2005

Keywords

Comments

Lesser primes A104388, repdigits A104389. What is the next term?
The next term is 444444444444444444444444444444444497. The first term with more than 100 digits is a(22) which has 109 digits. - Harvey P. Dale, Jun 28 2011

Crossrefs

Programs

  • Mathematica
    Union[Flatten[Table[NextPrime/@Select[FromDigits/@Table[PadLeft[{i},n,i], {n,45}], Mean[{NextPrime[#],NextPrime[#,-1]}]==#&], {i,9}]]] (* Harvey P. Dale, Jun 28 2011 *)
  • Python
    from itertools import count, islice
    from sympy import isprime, prevprime
    def agen():
        for d in count(1):
            ru = int("1"*d)
            for r in range(ru, 10*ru, ru):
                if r > 2:
                    p = prevprime(r)
                    if isprime(r + (r-p)) and prevprime(r+(r-p)) == p:
                        yield 2*r - p
    print(list(islice(agen(), 15))) # Michael S. Branicky, Jun 30 2022

Formula

a(n) = prime(A104386(n)+1).

Extensions

More terms from Giovanni Resta, Apr 05 2006

A104389 Repdigits which are the average of two successive primes.

Original entry on oeis.org

4, 6, 9, 99, 111, 4444, 111111111, 555555555555, 9999999999999999, 111111111111111111, 444444444444444444, 555555555555555555555, 777777777777777777777777, 333333333333333333333333333333333, 444444444444444444444444444444444444
Offset: 1

Views

Author

Zak Seidov, Mar 04 2005

Keywords

Crossrefs

Corresponding primes: A104387, A104388.

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, prevprime
    def agen():
        for d in count(1):
            ru = int("1"*d)
            for r in range(ru, 10*ru, ru):
                if r > 2:
                    p = prevprime(r)
                    if isprime(r + (r-p)) and prevprime(r+(r-p)) == p:
                        yield r
    print(list(islice(agen(), 15))) # Michael S. Branicky, Jun 30 2022

Formula

a(n) = (A104387(n)+A104388(n))/2.

Extensions

More terms from Giovanni Resta, Apr 05 2006

A104386 Numbers k such that the average of the k-th and (k+1)-th primes is a repdigit.

Original entry on oeis.org

2, 3, 4, 25, 29, 603, 6363181, 21366409911, 279238341033925, 2907021742443974, 11220808305309952, 11885037375341198280
Offset: 1

Views

Author

Zak Seidov, Mar 04 2005

Keywords

Crossrefs

Cf. A054268.
Corresponding primes A104387, A104388, repdigits A104389.

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, prevprime, primepi
    def agen():
        for d in count(1):
            ru = int("1"*d)
            for r in range(ru, 10*ru, ru):
                if r > 2:
                    p = prevprime(r)
                    if isprime(r + (r-p)) and prevprime(r+(r-p)) == p:
                        yield primepi(p)
    print(list(islice(agen(), 7))) # Michael S. Branicky, Jun 30 2022

Formula

(prime(k) + prime(k+1))/2 = repdigit.

Extensions

a(8) from Giovanni Resta, Apr 05 2006
a(9) from Michael S. Branicky, Jul 02 2022
a(10)-a(12) from Chai Wah Wu, Jun 01 2024

A114370 Primes p such that the sum of numbers from prime p to nextprime(p)-1 is a repdigit.

Original entry on oeis.org

2, 3, 5, 53, 55555553, 55555555555555555555555553, 2777777777777777777777777777777777777
Offset: 1

Views

Author

Giovanni Resta, Feb 09 2006

Keywords

Comments

The sequence is built under the (reasonable) assumption that 100+2*log(p)^2 is an upper bound to the largest gap between a prime p and nextprime(p). Under this assumption there are no other terms with less than 100 digits.

Examples

			nextprime(55555555555555555555555553) is 55555555555555555555555559 and the sum
from 55555555555555555555555553 to 55555555555555555555555558 gives the repdigit 333333333333333333333333333.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    from sympy.abc import x,y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A114370_gen(): # generator of terms
        for l in count(1):
            c = []
            for m in range(1,10):
                k = m*(10**l-1)//9<<1
                for a, b in diop_quadratic((x-y)*(x+y-1)-k):
                    if isprime(b) and a == nextprime(b):
                        c.append(b)
            yield from sorted(c)
    A114370_list = list(islice(A114370_gen(),6)) # Chai Wah Wu, Jun 02 2024
Showing 1-9 of 9 results.