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.

User: Don N. Page

Don N. Page's wiki page.

Don N. Page has authored 10 sequences.

A370531 The smallest number in base n such that two digits (and no fewer) need to be changed to get a prime.

Original entry on oeis.org

8, 24, 24, 90, 90, 119, 200, 117, 200, 319, 528, 1131, 1134, 525, 1328, 1343, 1332, 1330, 1340, 2478, 7260, 1334, 5352, 4300, 5954, 4833, 13188, 8468, 10800, 15686, 11744, 19338, 19618, 22575, 19620, 15688, 28234, 19617, 25480, 31406, 19614, 40291, 25476, 31410
Offset: 2

Author

Don N. Page, Feb 21 2024

Keywords

Comments

Any digit, including the most significant, can be changed to 0.
If one defines the Prime-Erdős-Number PEN(n, k) in base n of a number k to be the minimum number of the base-n digits of k that must be changed to get a prime, then a(n) is the smallest number k such that PEN(n, k) = 2.
Adding preceding 0's to be changed does not appear to change any of the entries given below.

Examples

			a(2) = 8 = 1000_2 can be changed to the prime 1011_2 (11 in decimal) by changing the last two digits.  Although 4 = 100_2 can be changed to the prime 111_2 by changing two digits, it can also be changed to the prime 101_2 by only one base-2 digit, so 4 is not a(2).
a(3) =  24 = 220_3 can be changed to 212_3 = 23. 24 is not prime and no single base-3 digit change works.
a(4) =  24 = 120_4 can be changed to 113_4 = 23.
a(5) =  90 = 330_5 -> 324_5 =  89.
a(6) =  90 = 230_6 -> 225_6 =  89.
a(7) = 119 = 230_7 -> 221_7 = 113.
a(8) = 200 = 310_8 -> 307_8 = 199.
a(9) = 117 = 140_9 -> 135_9 = 113.
Often, there are alternative ways to change two digits to get alternative primes, but for each a(n), there is not any way to get a prime by changing 0 or 1 digits in base n.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    from sympy.ntheory import digits
    from itertools import combinations, count, product
    def fromdigits(d, b): return sum(di*b**i for i, di in enumerate(d[::-1]))
    def PEN(base, k):
        if isprime(k): return 0
        d = digits(k, base)[1:]
        for j in range(1, len(d)+1):
            for c in combinations(range(len(d)), j):
                for p in product(*[[i for i in range(base) if i!=d[c[m]]] for m in range(j)]):
                    dd = d[:]
                    for i in range(j): dd[c[i]] = p[i]
                    if isprime(fromdigits(dd, base)): return j
    def a(n): return next(k for k in count(n) if PEN(n, k) == 2)
    print([a(n) for n in range(2, 32)]) # Michael S. Branicky, Feb 21 2024

Extensions

a(11) and beyond from Michael S. Branicky, Feb 21 2024

A367992 Smallest nonprime that is the n-th prime plus a multiple of the (n-1)-st primorial.

Original entry on oeis.org

4, 9, 35, 187, 221, 2323, 120137, 1021039, 19399403, 223092899, 6469693261, 200560490167, 7420738134851, 304250263527253, 39248283995010137, 614889782588491463, 65178316954380089519, 3845520700308425278201, 117288381359406970983337, 7858321551080267055879161
Offset: 1

Author

Don N. Page, Dec 07 2023

Keywords

Examples

			For n = 1, the n-th prime (2) plus a multiple m of the (n-1) primorial (1) is 2+m, giving the smallest nonprime, a(1)=4, when m=2.
For n = 4, the n-th prime (7) plus a multiple m of the (n-1) primorial (30) is 7+30m, giving the smallest nonprime, a(4)=187, when m=6.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = Prime[n], r = Product[Prime[i], {i, 1, n - 1}]}, While[p += r; PrimeQ[p]]; p]; Array[a, 20] (* Amiram Eldar, Dec 07 2023 *)

A370572 The smallest number which in base n requires 3 digit changes to convert k into a prime.

Original entry on oeis.org

84, 1953, 34560, 7000485, 354748446, 77478704205, 1878528135128, 48398467146642
Offset: 2

Author

Michael S. Branicky and Don N. Page, Feb 22 2024

Keywords

Comments

Leading digits may be changed to 0.
a(6)-a(9) converted from A133219.
a(10) <= 977731833235239280 is also from A133219, but not proved minimal.

Crossrefs

A250302 Positive integers k whose square is, for some prime p, the largest integer m such that both m and m-1 factor into primes less than or equal to p.

Original entry on oeis.org

3, 9, 99, 351, 13311, 1205645, 138982582999
Offset: 1

Author

Don N. Page, Jan 15 2015

Keywords

Comments

a(n)^2-1 and a(n)^2 form the largest pair of consecutive p-smooth numbers.
Terms are the square roots of square values of A117581(=A002072+1).
The corresponding primes p are in A250298.

Examples

			Here are the largest pairs of consecutive integers with prime factors p or smaller:
p   : pair
--------------------------
3   : 3^2-1 and 3^2;
5   : 9^2-1 and 9^2;
11  : 99^2-1 and 99^2;
13  : 351^2-1 and 351^2;
29  : 13311^2-1 and 13311^2;
53  : 1205645^2-1 and 1205645^2;
103 : 138982582999^2-1 and 138982582999^2.
		

Crossrefs

Programs

  • PARI
    lista(v_002072) = {v = v_002072; for (i=1, #v, vi = v[i]; if (issquare(vi+1), print1(sqrtint(vi+1), ", ")););} \\ Michel Marcus, Feb 28 2015

A250298 Primes p such that the largest integer m such that both m and m-1 factor into primes less than or equal to p is a perfect square, m = k^2.

Original entry on oeis.org

3, 5, 11, 13, 29, 53, 103
Offset: 1

Author

Don N. Page, Jan 15 2015

Keywords

Comments

List of primes p = A000040(i) such that A117581(i) (that is, A002072(i)+1) is a perfect square.
There are no analogous primes p < 107 for which m-1 defined above is a perfect square.

Examples

			p = 3 gives m = 3^2;
p = 5 gives m = 9^2;
p = 11 gives m = 99^2;
p = 13 gives m = 351^2;
p = 29 gives m = 13311^2;
p = 53 gives m = 1205645^2;
p = 103 gives m = 138982582999^2.
		

Crossrefs

A228611 Primes p such that the largest consecutive pair of p-smooth integers is the same as the largest consecutive pair of (p-1)-smooth integers.

Original entry on oeis.org

23, 67, 83, 89, 97, 101
Offset: 1

Author

Don N. Page, Dec 18 2013

Keywords

Comments

For each such prime p = a(n), the smallest superparticular ratio R = m/(m-1) such that R factors into primes less than or equal to p have all of these prime factors strictly less than p.
p = a(n) here equals prime(k) for the values of k that make a(k) = a(k-1) in A002072 and also in A117581.

Examples

			For n = 1, a(1) = 23 is a prime such that the largest consecutive pair of 23-smooth integers, (11859210,11859211), is the same as the largest consecutive pair of 22-smooth integers (or of 19-smooth integers, 19 being the next smaller prime).
		

Crossrefs

Cf. A002072, A117581, A228610 gives the index of the prime that is a(n) here.

A228610 Numbers k such that the largest consecutive pair of prime(k)-smooth integers is the same as the largest consecutive pair of prime(k-1)-smooth integers.

Original entry on oeis.org

9, 19, 23, 24, 25, 26
Offset: 1

Author

Don N. Page, Dec 18 2013

Keywords

Comments

For each such k = a(n), the smallest superparticular ratio R = m/(m-1) such that R factors into primes less than or equal to prime(k) have all of these prime factors strictly less than prime(k).
k = a(n) here are the values of k that make a(k) = a(k-1) in A002072 and also in A117581.

Examples

			For n = 1, k = a(1) = 9 gives prime(k) = 23 such that the largest consecutive pair of 23-smooth integers, (11859210,11859211), is the same as the largest consecutive pair of prime(k-1)-smooth integers (19-smooth integers).
		

Crossrefs

Cf. A002072, A117581, A228611 gives prime(k) corresponding to k here.

A111203 x such that pi(x)/li(x) is greater than it is for all smaller x > 1.5.

Original entry on oeis.org

2, 1051, 1063, 1069, 1097, 1103, 1109, 1123, 1129, 1303, 1307, 1321, 1327, 1619, 1621, 1627, 2399, 2447, 2477, 2719, 2731, 2753, 2801, 2803, 3929, 3931, 3947, 4273, 4289, 4297, 5851, 5857, 5861, 5867, 5869, 5881, 6367, 6373, 6379, 9433, 9437, 9439
Offset: 1

Author

Don N. Page, Oct 24 2005

Keywords

Comments

This will be a very long but finite sequence, since pi(x)/li(x) will exceed unity for some very large values of x (as Littlewood first showed) but then will asymptotically tend to unity by the prime number theorem. One large but unknown element of the sequence will be the smallest x for which pi(x)>li(x).

Examples

			For 1.5<x<2, li(x)>0 and pi(x)=0, so pi(x)/li(x)=0. a(1)=2 because at x=2, pi(x)/li(x) has its increase, to 1/li(2)=0.9567878442. a(2)=1051 because x=1051 gives the next time pi(x)/li(x) gives a higher value, 177/Li(1051)=0.956932676.
		

Programs

  • Maple
    with(numtheory): Digits:=50; s:=0: for n from 1 to 10000 do if (evalf(n/Li(ithprime(n)))>s) then s:=evalf(n/Li(ithprime(n))): print(ithprime(n)) else s:=s end if end do;

A104767 a(n)=n for n <= 3, a(n) = 2a(n-1) - 2a(n-2) + 2a(n-3) for n >= 4.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 10, 16, 24, 36, 56, 88, 136, 208, 320, 496, 768, 1184, 1824, 2816, 4352, 6720, 10368, 16000, 24704, 38144, 58880, 90880, 140288, 216576, 334336, 516096, 796672, 1229824, 1898496, 2930688, 4524032, 6983680, 10780672, 16642048, 25690112, 39657472
Offset: 0

Author

Don N. Page, Oct 13 2005

Keywords

Comments

Also a(n) for n > 0 is the number of terms in the expansion of (x - y) * (x - y) * (x^2 - y^2) * (x^3 - y^3) * ... * (x^F_n-1 - y^F_n-1), where F_n is the n-th Fibonacci number. In this definition one can take y=1. In other words the sequence gives the number of nonzero terms in the polynomial Product {k=1..n-1}, (1 - x^F_k). - Robert G. Wilson v, May 12 2013
Also a(n) for n > 0 is the number of terms in the expansion of Product_{k=2..n+1} (x^F_k - y^F_k) with coefficient +1 (same with -1). We can take y=1 and the Product_{k=2..n+1} (x^F_k - 1) has a(n) terms with coefficient +1 and same with -1. Note that no coefficient is greater than 1 in absolute value. - Michael Somos, May 17 2018

Examples

			From _Michael Somos_, May 17 2018: (Start)
For n=3, (x - y) * (x - y) = x^2 - 2*x*y + y^2 has a(3) = 3 terms.
For n=4, (x - y) * (x - y) * (x^2 - y^2) = x^4 - 2*x^3*y + 2*x*y^3 - y^4 has a(4) = 4 terms.
for n=2, (x - y) * (x^2 - y^2) = x^3 - x^2*y - x*y^2 + y^3 has a(2) = 2 terms with + sign and also with - sign.
For n=3, (x - y) * (x^2 - y^2) * (x^3 - y^3) = x^6 - x^5*y - x^4*y^2 + x^2*y^4 + x*y^5 - y^6 has a(3) = 3 terms with + sign and also with - sign. (End)
		

Crossrefs

Cf. A093996.

Programs

  • GAP
    a:=[0,1,2,3,4];; for n in [5..50] do a[n]:=2*a[n-1]-2*a[n-2]+2*a[n-3]; od; a; # Muniru A Asiru, May 17 2018
    
  • Maple
    f:=proc(n) option remember; if n <= 4 then RETURN(n); fi; 2*f(n-4)+f(n-1); end;
  • Mathematica
    a[n_] := a[n] = If[n < 4, n, 2a[n - 1] - 2a[n - 2] + 2a[n - 3]]; Table[ a[n], {n, 0, 39}] (* Robert G. Wilson v *)
    Join[{0}, LinearRecurrence[{2, -2, 2}, {1, 2, 3}, 41]] (* Robert G. Wilson v, May 12 2013 *)
    Join[{0}, LinearRecurrence[{1, 0, 0, 2}, {1, 2, 3, 4}, 41]] (* Robert G. Wilson v, May 12 2013 *)
    a[n_] := Length@ ExpandAll@ Product[1 - x^Fibonacci[k], {k, n-1}]; a[1] = 1; (* Robert G. Wilson v, May 12 2013 *)
    nxt[{a_,b_,c_}]:={b,c,2c-2b+2a}; Join[{0},NestList[nxt,{1,2,3},40][[All,1]]] (* Harvey P. Dale, Nov 30 2021 *)
  • PARI
    a=vector(100); a[1]=1;a[2]=2;a[3]=3; for(n=4, #a, a[n] = 2*a[n-1]-2*a[n-2]+2*a[n-3]); concat(0,a) \\ Altug Alkan, May 18 2018

Formula

a(n) = n for n <= 4; for n >= 5, a(n) = 2a(n-4) + a(n-1).
G.f.: (x + x^3)/(-2*x^3 + 2*x^2 - 2*x + 1). a(n) = A077943(n-3) + A077943(n-1).

Extensions

More terms from Robert G. Wilson v, Oct 14 2005

A029549 a(n + 3) = 35*a(n + 2) - 35*a(n + 1) + a(n), with a(0) = 0, a(1) = 6, a(2) = 210.

Original entry on oeis.org

0, 6, 210, 7140, 242556, 8239770, 279909630, 9508687656, 323015470680, 10973017315470, 372759573255306, 12662852473364940, 430164224521152660, 14612920781245825506, 496409142337836914550, 16863297918705209269200, 572855720093639278238256
Offset: 0

Author

Keywords

Comments

Triangular numbers that are twice other triangular numbers. - Don N. Page
Triangular numbers that are also pronic numbers. These will be shown to have a Pythagorean connection in a paper in preparation. - Stuart M. Ellerstein (ellerstein(AT)aol.com), Mar 09 2002
In other words, triangular numbers which are products of two consecutive numbers. E.g., a(2) = 210: 210 is a triangular number which is the product of two consecutive numbers: 14 * 15. - Shyam Sunder Gupta, Oct 26 2002
Coefficients of the series giving the best rational approximations to sqrt(8). The partial sums of the series 3 - 1/a(1) - 1/a(2) - 1/a(3) - ... give the best rational approximations to sqrt(8) = 2 sqrt(2), which constitute every second convergent of the continued fraction. The corresponding continued fractions are [2; 1, 4, 1], [2; 1, 4, 1, 4, 1], [2; 1, 4, 1, 4, 1, 4, 1], [2; 1, 4, 1, 4, 1, 4, 1, 4, 1] and so forth. - Gene Ward Smith, Sep 30 2006
This sequence satisfy the same recurrence as A165518. - Ant King, Dec 13 2010
Intersection of A000217 and A002378.
This is the sequence of areas, x(n)*y(n)/2, of the ordered Pythagorean triples (x(n), y(n) = x(n) + 1,z(n)) with x(0) = 0, y(0) = 1, z(0) = 1, a(0) = 0 and x(1) = 3, y(1) = 4, z(1) = 5, a(1) = 6. - George F. Johnson, Aug 20 2012

Programs

  • GAP
    List([0..20], n-> (Lucas(2,-1, 4*n+2)[2] -6)/32 ); # G. C. Greubel, Jan 13 2020
  • Haskell
    a029549 n = a029549_list !! n
    a029549_list = [0,6,210] ++
       zipWith (+) a029549_list
                   (map (* 35) $ tail delta)
       where delta = zipWith (-) (tail a029549_list) a029549_list
    -- Reinhard Zumkeller, Sep 19 2011
    
  • Macsyma
    (makelist(binom(n,2),n,1,999999),intersection(%%,2*%%)) /* Bill Gosper, Feb 07 2010 */
    
  • Magma
    R:=PowerSeriesRing(Integers(), 25); [0] cat Coefficients(R!(6/(1-35*x+35*x^2-x^3))); // G. C. Greubel, Jul 15 2018
    
  • Maple
    A029549 := proc(n)
        option remember;
        if n <= 1 then
            op(n+1,[0,6]) ;
        else
            34*procname(n-1)-procname(n-2)+6 ;
        end if;
    end proc: # R. J. Mathar, Feb 05 2016
  • Mathematica
    Table[Floor[(Sqrt[2] + 1)^(4n + 2)/32], {n, 0, 20} ] (* Original program from author, corrected by Ray Chandler, Jul 09 2015 *)
    CoefficientList[Series[6/(1 - 35x + 35x^2 - x^3), {x, 0, 14}], x]
    Intersection[#, 2#] &@ Table[Binomial[n, 2], {n, 999999}] (* Bill Gosper, Feb 07 2010 *)
    LinearRecurrence[{35, -35, 1}, {0, 6, 210}, 20] (* Harvey P. Dale, Jun 06 2011 *)
    (LucasL[4Range[20] - 2, 2] -6)/32 (* G. C. Greubel, Jan 13 2020 *)
  • PARI
    concat(0,Vec(6/(1-35*x+35*x^2-x^3)+O(x^25))) \\ Charles R Greathouse IV, Jun 13 2013
    
  • Sage
    [(lucas_number2(4*n+2, 2, -1) -6)/32 for n in (0..20)] # G. C. Greubel, Jan 13 2020
    
  • Scala
    val triNums = (0 to 39999).map(n => (n * n + n)/2)
    triNums.filter( % 2 == 0).filter(n => (triNums.contains(n/2))) // _Alonso del Arte, Jan 12 2020
    

Formula

G.f.: 6*x/(1 - 35*x + 35*x^2 - x^3) = 6*x /( (1-x)*(1 - 34*x + x^2) ).
a(n) = 6*A029546(n-1) = 2*A075528(n).
a(n) = -3/16 + ((3+2*sqrt(2))/32) *(17 + 12*sqrt(2))^n + ((3-2*sqrt(2))/32) *(17 - 12*sqrt(2))^n. - Gene Ward Smith, Sep 30 2006
From Bill Gosper, Feb 07 2010: (Start)
a(n) = (cosh((4*n + 2)*log(1 + sqrt(2))) - 3)/16.
a(n) = binomial(A001652(n) + 1, 2) = 2*binomial(A053141(n) + 1, 2). (End)
a(n) = binomial(A046090(n), 2) = A000217(A001652(n)). - Mitch Harris, Apr 19 2007, R. J. Mathar, Jun 26 2009
a(n) = ceiling((3 + 2*sqrt(2))^(2n + 1) - 6)/32 = floor((1/32) (1+sqrt(2))^(4n+2)). - Ant King, Dec 13 2010
Sum_{n >= 1} 1/a(n) = 3 - 2*sqrt(2) = A157259 - 4. - Ant King, Dec 13 2010
a(n) = a(n - 1) + A001109(2n). - Charlie Marion, Feb 10 2011
a(n+2) = 34*a(n + 1) - a(n) + 6. - Charlie Marion, Feb 11 2011
From George F. Johnson, Aug 20 2012: (Start)
a(n) = ((3 + 2*sqrt(2))^(2*n + 1) + (3 - 2*sqrt(2))^(2*n + 1) - 6)/32.
8*a(n) + 1 = (A002315(n))^2, 4*a(n) + 1 = (A000129(2*n + 1))^2, 32*a(n)^2 + 12*a(n) + 1 are perfect squares.
a(n + 1) = 17*a(n) + 3 + 3*sqrt((8*a(n) + 1)*(4*a(n) + 1)).
a(n - 1) = 17*a(n) + 3 - 3*sqrt((8*a(n) + 1)*(4*a(n) + 1)).
a(n - 1)*a(n + 1) = a(n)*(a(n) - 6), a(n) = A096979(2*n).
a(n) = (1/2)*A084159(n)*A046729(n) = (1/2)*A001652(n)*A046090(n).
Limit_{n->infinity} a(n)/a(n - 1) = 17 + 12*sqrt(2).
Limit_{n->infinity} a(n)/a(n - 2) = (17 + 12*sqrt(2))^2 = 577 + 408*sqrt(2).
Limit_{n->infinity} a(n)/a(n - r) = (17 + 12*sqrt(2))^r.
Limit_{n->infinity} a(n - r)/a(n) = (17 + 12*sqrt(2))^(-r) = (17 - 12*sqrt(2))^r. (End)
a(n) = 3 * T( b(n) ) + (2*b(n) + 1)*sqrt( T( b(n) ) ) where b(n) = A001108(n) (indices of the square triangular numbers), T(n) = A000217(n) (the n-th triangular number). - Dimitri Papadopoulos, Jul 07 2017
a(n) = (Pell(2*n + 1)^2 - 1)/4 = (Q(4*n + 2) - 6)/32, where Q(n) are the Pell-Lucas numbers (A002203). - G. C. Greubel, Jan 13 2020
a(n) = A002378(A011900(n)-1) = A002378(A053141(n)). - Pontus von Brömssen, Sep 11 2024

Extensions

Additional comments from Christian G. Bower, Sep 19 2002; T. D. Noe, Nov 07 2006; and others
Edited by N. J. A. Sloane, Apr 18 2007, following suggestions from Andrew S. Plewe and Tanya Khovanova