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: Chris Boyd

Chris Boyd's wiki page.

Chris Boyd has authored 18 sequences. Here are the ten most recent ones:

A323185 Denominators of rationals whose continued fraction representations show the prime factors of n (for n > 1) in nondecreasing order.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 12, 10, 11, 11, 17, 13, 15, 16, 29, 17, 23, 19, 27, 22, 23, 23, 41, 26, 27, 33, 37, 29, 37, 31, 70, 34, 35, 36, 56, 37, 39, 40, 65, 41, 51, 43, 57, 53, 47, 47, 99, 50, 57, 52, 67, 53, 76, 56, 89, 58, 59, 59, 90, 61, 63, 73, 169, 66, 79, 67, 87
Offset: 2

Author

Chris Boyd, Jan 06 2019

Keywords

Comments

a(n) is the denominator of the generating rational of n (see comments and numerators in A323184).
If n is prime, a(n) is n.

Examples

			a(28) = 37 because 15/37 = [0; 2, 2, 7] and 2*2*7 = 28.
a(29) = 29 because 1/29 = [0; 29] = 29.
		

Crossrefs

Cf. A323184.

Programs

  • Mathematica
    Array[Denominator@ FromContinuedFraction@ Prepend[Flatten@ Map[ConstantArray[ #1, #2] &  @@ # &, FactorInteger@ #], 0] &, 67, 2] (* Michael De Vlieger, Jan 07 2019 *)
  • PARI
    vectorise_factors(m)={v=[0];F=factor(m);for(i=1,matsize(F)[1],for(j=1,F[i,2],v=concat(v,F[i,1])));}
    A323185(n)={vectorise_factors(n); contfracpnqn(v)[2,1];}
    for(k=2,75,print1(A323185(k)", "))

A323184 Numerators of rationals whose continued fraction representations show the prime factors of n (for n>1) in nondecreasing order.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 5, 3, 5, 1, 7, 1, 7, 5, 12, 1, 10, 1, 11, 7, 11, 1, 17, 5, 13, 10, 15, 1, 16, 1, 29, 11, 17, 7, 23, 1, 19, 13, 27, 1, 22, 1, 23, 16, 23, 1, 41, 7, 26, 17, 27, 1, 33, 11, 37, 19, 29, 1, 37, 1, 31, 22, 70, 13, 34, 1, 35, 23, 36, 1, 56, 1, 37, 26
Offset: 2

Author

Chris Boyd, Jan 06 2019

Keywords

Comments

Denominators are given in A323185.
From its prime factorization, each natural number N>1 can be uniquely represented as a tuple of nondecreasing first powers (e.g., 60 = 2*2*3*5 -> (2, 2, 3, 5)).
There is a unique positive finite continued fraction associated with N whose coefficients in the standard abbreviated notation (except for the first coefficient, which is arbitrarily set to zero) map 1-to-1 to the elements of the tuple, from which the corresponding generating rational can be calculated (e.g. 60 -> [0; 2, 2, 3, 5] = 37/90).
The first few generating rationals are:
N ... GR .... continued fraction
2 ... 1/2 ... [0; 2]
3 ... 1/3 ... [0; 3]
4 ... 2/5 ... [0; 2, 2]
5 ... 1/5 ... [0; 5]
6 ... 3/7 ... [0; 2, 3]
7 ... 1/7 ... [0; 7]
8 ... 5/12 .. [0; 2, 2, 2]
9 ... 3/10 .. [0; 3, 3]
10 .. 5/11 .. [0; 2, 5]
a(n) is the numerator of the generating rational of n.
Iff n is prime, a(n) is 1.

Examples

			a(28) = 15 because 15/37 = [0; 2, 2, 7] and 2*2*7 = 28.
a(29) = 1 because 1/29 = [0; 29] = 29.
		

Crossrefs

Cf. A323185.

Programs

  • Mathematica
    Array[Numerator@ FromContinuedFraction@ Prepend[Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger@ #], 0] &, 74, 2] (* Michael De Vlieger, Jan 07 2019 *)
  • PARI
    vectorise_factors(m)={v=[0];F=factor(m);for(i=1,matsize(F)[1],for(j=1,F[i,2],v=concat(v,F[i,1])));}
    A323184(n)={vectorise_factors(n); contfracpnqn(v)[1,1];}
    for(k=2,75,print1(A323184(k)", "))

A266214 Numbers n that are not coprime to the numerator of zeta(2*n)/(Pi^(2*n)).

Original entry on oeis.org

14, 22, 26, 28, 30, 38, 42, 44, 46, 50, 52, 54, 56, 58, 60, 62, 70, 74, 76, 78, 82, 84, 86, 88, 90, 92, 94, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 134, 138, 140, 142, 146, 148, 150, 152, 154, 156, 158, 162, 164, 166, 168, 170
Offset: 1

Author

Chris Boyd, Robert Israel, Dec 24 2015

Keywords

Comments

Equivalently, n not coprime to the numerator of 2^(2n-1)*Bernoulli(2n)/(2n)! (see Lekraj Beedassy comment in A046988).
Conjecture 1: for n>=1, a(n) is identical to 2*A072823(n+1).
Conjecture 2: The corresponding GCDs are powers of 2.
Verified for n <= 10000, e.g.,
GCD = 2 for 14, 22, 26, 28, 30, 38, 42, 44, 46, 50, 52, 54, 56, 58, ...
GCD = 4 for 60, 92, 108, 116, 120, 124, 156, 172, 180, 184, 188, ...
GCD = 8 for 248, 376, 440, 472, 488, 496, 504, 632, 696, 728, 744, ...
GCD = 16 for 1008, 1520, 1776, 1904, 1968, 2000, 2016, 2032, 2544, ...
GCD = 32 for 4064, 6112, 7136, 7648, 7904, 8032, 8096, 8128, 8160
Taking GCDs vertically, column 1 = "14, 60, 248, 1008, 4064, ..." appears to be essentially the same as A171499 and A131262; (ii) column 2 = "22, 92, 376, 1520, 6112, ..." appears to be essentially the same as A010036.
From Chris Boyd, Jan 25 2016: (Start)
Determining whether n is a term of this sequence can be approached by considering odd and even factors separately, and exploiting the fact that numerator(zeta(2n)/(Pi^(2n))) = numerator(2^(2n-2)*N_2n/(D_2n*(2n)!)), where N_2n and D_2n are odd coprime integers such that Bernoulli(2n) = N_2n/2D_2n.
Case 1: odd factors. n is a term if it has an odd prime factor p (necessarily irregular) that divides N_2n at a higher multiplicity than it divides (2n)!. No such factor p of N_2n up to 2n = 10000 is of sufficient multiplicity, and the apparent scarcity of squared and higher power factors of N_2n values (see A090997) suggests that no such p is likely to exist.
Case 2: even factors. An even n is a term if 2 divides 2^(2n-2) at a higher multiplicity than it divides (2n)!. The multiplicity of 2 in 2^(2n-2) is 2n-2, and in (2n)! is 2n minus the number of 1's in the binary expansion of 2n (see A005187). Qualifying n values are therefore those where the number of 1's in the binary expansion of 2n is greater than 2. Except for its first term, A072823 comprises integers with three or more 1-bits in their binary expansion. It follows that for m > 1, 2*A072823(m) values belong to this sequence.
In summary, this sequence is essentially a supersequence of 2*A072823. Conjectures 1 and 2 are true if there are no irregular odd primes p that divide n and the numerator of Bernoulli(2n)/(2n)!. (End)

Crossrefs

Programs

  • Maple
    select(n -> igcd(n,numer(2^(2*n-1)*bernoulli(2*n)/(2*n)!)) > 1), [$1..1000]);
  • Mathematica
    Select[Range@ 170, ! CoprimeQ[#, Numerator[Zeta[2 #]/Pi^(2 #)]] &] (* Michael De Vlieger, Dec 24 2015 *)
  • PARI
    test(n) = if(gcd(numerator(2^(2*n-1)*bernfrac(2*n)/(2*n)!),n)!=1,1,0)
    for(i=1,200,if(test(i),print1(i,", ")))

A264722 Composite numbers that are less than the average of their closest flanking primes.

Original entry on oeis.org

8, 14, 20, 24, 25, 32, 33, 38, 44, 48, 49, 54, 55, 62, 63, 68, 74, 75, 80, 84, 85, 90, 91, 92, 98, 104, 110, 114, 115, 116, 117, 118, 119, 128, 132, 133, 140, 141, 142, 143, 152, 153, 158, 159, 164, 168, 169, 174, 175, 182, 183, 184, 185, 194, 200, 201, 202, 203
Offset: 1

Author

Chris Boyd, Nov 21 2015

Keywords

Comments

Composite numbers that are nearer to the immediately previous prime than to the immediately next prime.
Members of this sequence are the numbers C, necessarily composite, such that P_n < C < I_n, where P_n is the n-th odd prime and I_n the interprime (A024675) between P_n and P_n+1.
Prime-free subsequence of A264720.

Examples

			a(7) = 33 because 33 < (31 + 37)/2 = 34.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 204, And[CompositeQ@ #, # < (NextPrime[#, -1] + NextPrime@ #)/2] &] (* Michael De Vlieger, Nov 22 2015 *)
    Range[#[[1]]+1,Total[#]/2 -1]&/@Select[Partition[Prime[Range[50]],2,1], #[[2]]- #[[1]]>2&]//Flatten  (* Harvey P. Dale, Jul 28 2020 *)
  • PARI
    test(n)= {if(n-precprime(n-1)2&&!isprime(n),return(1),return(0))}
    for(i=1,200,if(test(i),print1(i,", ")))

A264721 Composite numbers that are greater than the average of their closest flanking primes.

Original entry on oeis.org

10, 16, 22, 27, 28, 35, 36, 40, 46, 51, 52, 57, 58, 65, 66, 70, 77, 78, 82, 87, 88, 94, 95, 96, 100, 106, 112, 121, 122, 123, 124, 125, 126, 130, 135, 136, 145, 146, 147, 148, 155, 156, 161, 162, 166, 171, 172, 177, 178, 187, 188, 189, 190, 196, 206, 207, 208
Offset: 1

Author

Chris Boyd, Nov 21 2015

Keywords

Comments

Composite numbers that are nearer to the immediately next prime than to the immediately previous prime.
Members of this sequence are the numbers C, necessarily composite, such that I_n < C < P_n+1, where P_n is the n-th odd prime and I_n the interprime (A024675) between P_n and P_n+1.
Prime-free subsequence of A264719.

Examples

			a(7) = 36 because 36 > (31 + 37)/2 = 34.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 208, And[CompositeQ@ #, # > (Abs@ NextPrime[#, -1] + NextPrime@ #)/2] &] (* Michael De Vlieger, Nov 22 2015 *)
  • PARI
    test(n)= {if(n-precprime(n-1)>nextprime(n+1)-n&&n>2&&!isprime(n),return(1),return(0))}
    for(i=1,200,if(test(i),print1(i,", ")))

A264720 Numbers that are less than the average of their closest flanking primes.

Original entry on oeis.org

3, 7, 8, 13, 14, 19, 20, 23, 24, 25, 31, 32, 33, 38, 43, 44, 47, 48, 49, 54, 55, 61, 62, 63, 68, 73, 74, 75, 80, 83, 84, 85, 89, 90, 91, 92, 98, 103, 104, 109, 110, 113, 114, 115, 116, 117, 118, 119, 128, 131, 132, 133, 139, 140, 141, 142, 143, 151, 152, 153, 158
Offset: 1

Author

Chris Boyd, Nov 21 2015

Keywords

Comments

Numbers that are nearer to the immediately previous prime than to the immediately next prime.
This sequence may be viewed as a generalization of A051635 (the weak primes) that includes qualifying composite numbers.
The union of this sequence with A264719 & A145025 is A000027 (omitting 1 & 2).

Examples

			a(11) = 31 because 31 < (29 + 37)/2 = 33.
a(12) = 32 because 32 < (31 + 37)/2 = 34.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 162, # < (NextPrime[#, -1] + NextPrime@ #)/2 &] (* Michael De Vlieger, Nov 22 2015 *)
  • PARI
    test(n)= {if(n-precprime(n-1)2,return(1),return(0))}
    for(i=1,200,if(test(i),print1(i,", ")))

A264719 Numbers that are greater than the average of their closest flanking primes.

Original entry on oeis.org

10, 11, 16, 17, 22, 27, 28, 29, 35, 36, 37, 40, 41, 46, 51, 52, 57, 58, 59, 65, 66, 67, 70, 71, 77, 78, 79, 82, 87, 88, 94, 95, 96, 97, 100, 101, 106, 107, 112, 121, 122, 123, 124, 125, 126, 127, 130, 135, 136, 137, 145, 146, 147, 148, 149, 155, 156, 161, 162
Offset: 1

Author

Chris Boyd, Nov 21 2015

Keywords

Comments

Numbers that are nearer to the immediately next prime than to the immediately previous prime.
This sequence may be viewed as a generalization of A051634 (the strong primes) that includes qualifying composite numbers.
The union of this sequence with A264720 & A145025 is A000027 (omitting 1 & 2).

Examples

			a(11) = 37 because 37 > (31 + 41)/2 = 36.
a(12) = 40 because 40 > (37 + 41)/2 = 37.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 162, # > (Abs@ NextPrime[#, -1] + NextPrime@ #)/2 &] (* Michael De Vlieger, Nov 22 2015 *)
  • PARI
    test(n)= {if(n-precprime(n-1)>nextprime(n+1)-n&&n>2,return(1),return(0))}
    for(i=1,200,if(test(i),print1(i,", ")))

A257231 a(n) = n^2 mod p where p is the least prime greater than n.

Original entry on oeis.org

1, 1, 4, 1, 4, 1, 5, 9, 4, 1, 4, 1, 16, 9, 4, 1, 4, 1, 16, 9, 4, 1, 7, 25, 16, 9, 4, 1, 4, 1, 36, 25, 16, 9, 4, 1, 16, 9, 4, 1, 4, 1, 16, 9, 4, 1, 36, 25, 16, 9, 4, 1, 36, 25, 16, 9, 4, 1, 4, 1, 36, 25, 16, 9, 4, 1, 16, 9, 4, 1, 4, 1, 36, 25, 16, 9, 4, 1, 16, 9, 4, 1, 36, 25, 16, 9, 4
Offset: 1

Author

Chris Boyd, Apr 19 2015

Keywords

Comments

Conjecture: a(n) is always a positive square, except for the terms 5, 7, 69, 42 and 17 given by n = 7, 23, 113, 114, and 115 respectively. It is easy to show that nonsquare terms are in [p, q) iff p and q are consecutive primes and q-p > sqrt(q). There are no gaps between consecutive primes greater than sqrt(q) for 127 < q < 4*10^18 (see Nicely's table of maximal prime gaps).

Examples

			a(23) = 7 because 23^2 mod 29 = 7.
a(24) = 25 because 24^2 mod 29 = 25.
		

Crossrefs

Cf. A257230.

Programs

  • Magma
    [n^2 mod NextPrime(n): n in [1..80]]; // Vincenzo Librandi, Apr 19 2015
  • Mathematica
    Table[Mod[n^2, NextPrime@ n], {n, 87}] (* Michael De Vlieger, Apr 19 2015 *)
    Table[PowerMod[n,2,NextPrime[n]],{n,90}] (* Harvey P. Dale, May 24 2015 *)
  • PARI
    a(n)=n^2%nextprime(n+1)
    

A257230 Floor(sqrt(q)-(q-p)), where p and q are consecutive primes.

Original entry on oeis.org

0, 0, 0, -1, 1, 0, 2, 0, -1, 3, 0, 2, 4, 2, 1, 1, 5, 2, 4, 6, 2, 5, 3, 1, 6, 8, 6, 8, 6, -3, 7, 5, 9, 2, 10, 6, 6, 8, 7, 7, 11, 3, 11, 10, 12, 2, 2, 11, 13, 11, 9, 13, 5, 10, 10, 10, 14, 10, 12, 14, 7, 3, 13, 15, 13, 4, 12, 8, 16, 14, 12, 11, 13, 13, 15, 13, 11, 16, 12, 10, 18
Offset: 1

Author

Chris Boyd, Apr 19 2015

Keywords

Comments

Conjecture: a(n) is always positive for n > 30, and is negative only for n = 4, 9 and 30, corresponding to prime pairs (7, 11), (23, 29) and (113, 127).
Related to prime gap conjectures by (e.g.) Legendre, Oppermann, Andrica and Brocard.

Examples

			a(30) = -3 because sqrt(127)-(127-113) = -2.73057...
a(31) = 7 because sqrt(131)-(131-127) = 7.44552...
		

Crossrefs

Cf. A257231.

Programs

  • Magma
    [Floor(Sqrt(NthPrime(n+1))-(NthPrime(n+1)-NthPrime(n))): n in [1..100]]; // Vincenzo Librandi, Apr 19 2015
  • Mathematica
    Table[Floor[Sqrt[NextPrime[Prime@ p]] - (NextPrime[Prime@ p] - Prime@ p)], {p, 81}] (* Michael De Vlieger, Apr 19 2015 *)
  • PARI
    a(n)=floor(sqrt(prime(n+1))-(prime(n+1)-prime(n)))
    

A240475 Primes that are midway between the closest flanking squarefree numbers.

Original entry on oeis.org

2, 17, 19, 53, 89, 163, 197, 199, 233, 251, 269, 271, 293, 307, 337, 379, 449, 487, 491, 521, 557, 593, 631, 701, 739, 751, 809, 811, 881, 883, 919, 953, 991, 1013, 1049, 1061, 1063, 1097, 1151, 1171, 1279, 1459, 1471, 1493, 1531, 1549, 1567, 1601, 1637
Offset: 1

Author

Chris Boyd, Apr 06 2014

Keywords

Comments

Primes for which the corresponding A240473(m) is equal to A240474(m).
Primes equal to the average of the closest flanking squarefree numbers.
Primes equal to the average of three consecutive squarefree numbers.
Most terms are such that a(n)+2 and a(n)-2 are the closest squarefree numbers. The first term > 2 for which this is not the case is a(880) = 47527.
494501773, 765921647, 930996623 are the terms < 10^9 that also belong to A176141.

Examples

			19 is a term because it is midway between the closest flanking squarefree numbers 17 and 21.
On the other hand, 29 is not a term because it is not midway between the closest flanking squarefree numbers 26 and 30.
		

Programs

  • Mathematica
    Select[Mean/@Partition[Select[Range[2000],SquareFreeQ],3,1],PrimeQ] (* Harvey P. Dale, Jul 27 2024 *)
  • PARI
    forprime(p=1,1650,forstep(j=p-1,1,-1,if(issquarefree(j),L=j;break));for(j=p+1,2*p,if(issquarefree(j),G=j;break));if(G-p==p-L,print1(p", ")))