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: Steven M. Altschuld

Steven M. Altschuld's wiki page.

Steven M. Altschuld has authored 8 sequences.

A356567 Numbers that generate increasing numbers of consecutive primes when doubled and added to the sequence of odd squares. (Positions of records in A354499.)

Original entry on oeis.org

1, 2, 11, 29, 326
Offset: 1

Author

Steven M. Altschuld, Aug 12 2022

Keywords

Comments

With a(1)=1, a(n) such that (2*x-1)^2 + 2*a(n) gives prime numbers for x=1 to k where the k for a(n) exceeds the k for a(n-1), a(n-2), ..., a(1).
Conjecture: this list is complete, since primes get farther apart as numbers increase. (2x-1)^2 + 2*29 generates many primes, with 38 of the first 43 and 105 of the first 156 values of x generating primes.
For the (2x-1)^2 + 2*29 values that are not prime, there seems to be a restriction on the factors. No values with prime factors below 29 were seen, nor were 41, 43, 53, 71, 73, 89, 97, ... For each of the other a(n) (or indeed any other natural number K), it seems there is a list of acceptable prime factors for the (2x-1)^2 + 2*K value. This gives a curious connection between addition and prime factors.
a(6) > 10^8, if it exists. - Amiram Eldar, Aug 15 2022

Examples

			a(1)=1, because 1^2+2*1=3 and 3^2+2*1=11 are prime but 5^2+2*1=27 is not, and thus k=2.
a(2)=2, because 1^2+2*2=5 ... 7^2+2*2=53 are prime but 9^2+2*2=85 is not, thus k=4.
a(3)=11, because 1^2+2*11=23 ... 9^2+2*11=103 are prime, thus k=5.
a(4)=29, because 1^2+2*29=59 ... 27^2+2*29=787 are all prime, thus k=14.
a(5)=326 because 1^2+2*326=653 ... 35^2+2*352=1877 are all prime, thus k=18.
		

Crossrefs

Cf. A016754 (odd squares), A354499 (consecutive primes generated by adding 2n to odd squares).
Cf. A145202 and A188459 (related to last term).

Programs

  • Mathematica
    f[n_] := Module[{k = 1}, While[PrimeQ[k^2 + 2*n], k += 2]; (k - 1)/2]; s = {}; fm = 0; Do[If[(fn = f[n]) > fm, fm = fn; AppendTo[s, n]], {n, 1, 10^3}]; s (* Amiram Eldar, Aug 15 2022 *)
  • PARI
    f(n) = my(k=1); while (isprime(k^2+2*n), k+=2); (k-1)/2; \\ A354499
    lista(nn) = my(m=0); for (n=1, nn, my(x = f(n)); if (x > m, m = x; print1(n, ", "));); \\ Michel Marcus, Aug 16 2022

A354499 Number of consecutive primes generated by adding 2n to the odd squares (A016754).

Original entry on oeis.org

2, 4, 1, 0, 2, 1, 0, 1, 1, 0, 5, 0, 0, 3, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 2, 0, 0, 14, 1, 0, 0, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0, 0, 4, 0, 0, 0, 1, 0, 2, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1, 1, 0, 0, 0, 0, 8, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 3, 0, 0, 1, 1, 0, 0, 0, 0, 2, 1, 0, 1, 1, 0
Offset: 1

Author

Steven M. Altschuld, Aug 15 2022

Keywords

Comments

Conjecture: a(n) <= 18 = a(326).
a(m) = 0 for m in A047845. - Michel Marcus, Aug 16 2022
I conjecture the opposite: a(n) is unbounded, and indeed for any k < 1 and any m there are >> x^k terms up to x with a(n) > m. At a very rough guess, there should be some n with 20-50 digits having a(n) > 18. - Charles R Greathouse IV, Oct 26 2022

Examples

			For n=1 we have 1^2+2*1=3 and 3^2+2*1=11 are prime but 5^2+2*1=27 is not, and thus a(1)=2.
For n=2, 1^2+2*2=5 ... 7^2+2*2=53 are prime but 9^2+2*2=85 is not, thus a(2)=4.
For n=3, 1^2+2*3=7 is prime but 3^2+2*3=15 is not thus a(3)=1.
For n=4, 1^2+2*4=9 which is not prime, thus a(4)=0.
		

Crossrefs

Cf. A005843 (even numbers), A016754 (odd squares), A356567 (positions of records).
Cf. A047845.

Programs

  • Maple
    f:= proc(n) local k;
      for k from 1 by 2 do
        if not isprime(k^2+2*n) then return (k-1)/2 fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 26 2023
  • Mathematica
    a[n_] := Module[{k = 1}, While[PrimeQ[k^2 + 2*n], k += 2]; (k - 1)/2]; Array[a, 100] (* Amiram Eldar, Aug 15 2022 *)
  • PARI
    a(n) = my(k=1); while (isprime(k^2+2*n), k+=2); (k-1)/2; \\ Michel Marcus, Aug 16 2022

Formula

a(n) is number of consecutive primes generated by (2x-1)^2+2n for x=1,2,3,4,

A346972 a(1)=1, a(2)=4, a(n) = (n*a(n-1) - (n-1)*a(n-2)) mod (n+1).

Original entry on oeis.org

1, 4, 2, 1, 3, 6, 0, 3, 7, 10, 4, 3, 5, 1, 9, 10, 8, 12, 4, 20, 10, 7, 13, 1, 25, 4, 18, 19, 17, 21, 13, 29, 31, 27, 35, 19, 13, 25, 1, 8, 36, 23, 5, 41, 15, 20, 10, 30, 40, 20, 8, 32, 38, 26, 50, 2, 40, 23, 57, 50, 2, 35, 33, 37, 29, 45, 13, 8, 18, 69, 39, 26
Offset: 1

Author

Steven M. Altschuld, Aug 09 2021

Keywords

Comments

Goes as high as 2917 before settling to a final value of 77 for all n >= 2982.

Programs

  • Mathematica
    a[1] = 1; a[2] = 4; a[n_] := a[n] = Mod[n*a[n - 1] - (n - 1)*a[n - 2], n + 1]; Array[a, 100] (* Amiram Eldar, Aug 10 2021 *)
    nxt[{n_,a_,b_}]:={n+1,b,Mod[b(n+1)-n*a,n+2]}; NestList[nxt,{2,1,4},80][[;;,2]] (* Harvey P. Dale, Oct 15 2023 *)
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; va[2] = 4; for (n=3, nn, va[n] = (n*va[n-1] - (n-1)*va[n-2]) % (n+1);); va;} \\ Michel Marcus, Aug 10 2021

Formula

a(n) = 77 for n >= 2982.

A346971 Smallest c which can be split into positive parts a and b with a+b=c, such that the divisors of a,b,c cover all numbers up to n.

Original entry on oeis.org

2, 3, 4, 8, 10, 12, 24, 45, 54, 88, 120, 182, 182, 360, 540, 1326, 1326, 3990, 5040, 5040, 5040, 9282, 9282, 25200, 25200, 65208, 65208, 118800, 118800, 651456, 651456, 651456, 651456, 651456, 651456, 2314200, 2314200, 2314200, 2314200, 16365396, 16365396
Offset: 2

Author

Steven M. Altschuld, Aug 09 2021

Keywords

Comments

a(37)..a(40) <= 2314200 via 1062048 + 1252152 = 2314200. - David A. Corneth, Aug 11 2021

Examples

			a(5) = 8, 3+5=8, divisors of 3, 5, and 8 are {1,3}, {1,5}, and {1,2,4,8}, which covers all of {1,2,3,4,5}.
a(9) = 45, 21+24=45, divisors of 21, 24, and 45 are {1,3,7,21}, {1,2,3,4,6,8,12,24}, and {1,3,5,9,15,45}, which covers all of {1,2,3,4,5,6,7,8,9}.
		

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=(k=1;While[Length@Select[Union@*Flatten@*Divisors/@(Join[{k},#]&/@Rest@IntegerPartitions[k,2]),SubsetQ[#,Range@n]&]<1,k++];k);Array[a,16] (* Giorgos Kalogeropoulos, Aug 13 2021 *)
  • Python
    from sympy import divisors
    from itertools import count
    def cond(a, b, c, n):
        return set(divisors(a)+divisors(b)+divisors(c)) >= set(range(1, n+1))
    def a(n):
        if n == 1: return 1
        for c in count(1):
            for a in range(1, c//2+1):
                if cond(a, c-a, c, n): return c
    print([a(n) for n in range(1, 17)]) # Michael S. Branicky, Aug 13 2021
    
  • Python
    def A346971(n):
        c, nlist = 1, list(range(1,n+1))
        while True:
            mlist = [m for m in nlist if c % m]
            if len(mlist) == 0: return c
            p = max(mlist)
            for a in range(p,c,p):
                for m in mlist:
                    if a % m and (c-a) % m:
                        break
                else:
                    return c
            c += 1 # Chai Wah Wu, Oct 13 2021

Formula

a(n) <= A003418(n) and a(n) <= a(n+1). - David A. Corneth, Aug 11 2021
a(n) >= (4*A003418(n))^(1/3). - Charles R Greathouse IV, Oct 14 2021

Extensions

a(16)-a(26) from Alois P. Heinz, Aug 09 2021
a(27)-a(36) from David A. Corneth, Aug 11 2021
a(37)-a(40) from Chai Wah Wu, Oct 13 2021
a(41)-a(42) from Chai Wah Wu, Oct 21 2021

A346970 Smallest c which can be split into positive integers a,b with a+b=c, such that a*b*c is divisible by each of the first n primes.

Original entry on oeis.org

2, 3, 5, 10, 21, 55, 182, 357, 1105, 2958, 16588, 51243, 106981, 608685, 3003455, 7497910, 52350909, 168539462, 1822961393, 3079378759
Offset: 1

Author

Steven M. Altschuld, Aug 09 2021

Keywords

Comments

From David A. Corneth, Aug 10 2021: (Start)
Let k be a candidate value for a(n) and let g = gcd(c, primorial(n)) = gcd(c, A002110(n)). Let p be the largest prime that primorial(n)/g is divisible by. Then at least one of a and b is divisible by p.
So we can check multiples m of p < k and see if m*(k-m)*k is divisible by primorial(n).
If that is the case then k can be written as a + b where 0 < a,b < k and a*b*k is divisible by primorial(n) and a(n) = k when each of 1..k-1 do not have that property. (End)
From Kevin P. Thompson, Jun 30 2022 and Sep 07 2022: (Start)
n a(n) = c a b a * b * c
---- ---------- ---------- ----------- ---------------
1 2 1 1 prime(1)#
2 3 1 2 prime(2)#
3 5 2 3 prime(3)#
4 10 3 7 prime(4)#
5 21 10 11 prime(5)#
6 55 13 42 prime(6)#
7 182 17 165 prime(7)#
8 357 110 247 prime(8)#
9 1105 231 874 prime(9)#
10 2958 1463 1495 prime(10)#
11 16588 1615 14973 2 * prime(11)#
12 51243 16835 34408 4 * prime(12)#
13 106981 49335 57646 prime(13)#
14 608685 81548 527137 2 * prime(14)#
15 3003455 595034 2408421 7 * prime(15)#
16 7497910 2741301 4756609 3 * prime(16)#
17 52350909 2975429 49375480 4 * prime(17)#
18 168539462 55318167 113221295 9 * prime(18)#
19 1822961393 223726938 1599234455 83 * prime(19)#
20 3079378759 256763535 2822615224 4 * prime(20)# (End)
a(21) <= 111610913771, a(22) <= 111610913771 both via (a, b, c) = (54966571731, 56644342040, 111610913771). a(24) <= 8163073396289 via (a, b, c) = (133445799584, 8029627596705, 8163073396289). - David A. Corneth, Sep 07 2022

Examples

			a(4) = 10 via 3+7=10 and 3*7*10 = 210 which is divisible by each of the first 4 primes, namely 2, 3, 5 and 7.
a(7) = 182 via 17+165=182. 17*165*182 = 510510 which is divisible by each of the first 7 primes, namely 2, 3, ..., 13, 17.
		

Crossrefs

Programs

  • Mathematica
    Do[Monitor[k=1; While[!Or@@And@@@(IntegerQ/@(#/Prime@Range@n)&/@Times@@@(Join[{k}, #]&/@IntegerPartitions[k, {2}])), k++]; Print@k,k], {n, 20}] (* Giorgos Kalogeropoulos, Aug 16 2021 *)
  • PARI
    a(n) = { if(n <= 3, return(prime(n))); P = vecprod(primes(n)); for(i = sqrtnint(P, 3) + 1, oo, if(iscanforA(n, i), return(i) ) ) }
    iscanforA(n, k) = { my(g = gcd(k, P), step); if(k^2*g < P, return(0)); step = hpf(P/g); forstep(i = step, k, step, if((i*(k-i)*k)%P == 0,  return(1) ) ); 0 }
    hpf(n) = my(f = factor(n)); f[#f~, 1] \\ David A. Corneth, Aug 10 2021
    
  • Python
    from sympy import primorial, primefactors, gcd
    def A346970(n):
        c, ps = 2, primorial(n)
        while True:
            m = ps//gcd(ps,c)
            if m == 1:
                return c
            p = max(primefactors(m))
            for a in range(p,c,p):
                if a*(c-a) % m == 0:
                    return c
            c += 1 # Chai Wah Wu, Oct 13 2021

Formula

A002110(n)^(1/3) < a(n) <= A002110(n). - David A. Corneth, Aug 10 2021
a(2k) <= Product_{i=1..k} p_2i, a(2k+1) <= Product_{i=0..k} p_{2i+1} where p_i is the i-th prime. - Chai Wah Wu, Oct 14 2021
a(n) >= (4*A002110(n))^(1/3), strengthening David's result above. This inequality is strict for n > 1. - Charles R Greathouse IV, Jun 30 2022

Extensions

a(12)-a(16) from David A. Corneth, Aug 10 2021
a(17)-a(18) from Kevin P. Thompson, Jun 30 2022
a(19)-a(20) from Kevin P. Thompson, Sep 07 2022
a(20) corrected by David A. Corneth, Sep 07 2022

A330426 Primes P where the distance to the nearest prime is greater than 2*log(P).

Original entry on oeis.org

211, 2179, 2503, 3967, 4177, 7369, 7393, 11027, 11657, 14107, 16033, 16787, 18013, 18617, 18637, 18839, 19661, 21247, 23719, 24281, 29101, 32749, 33247, 33679, 33997, 37747, 38501, 40063, 40387, 42533, 42611, 44417, 46957, 51109, 51383, 53479, 54217, 55291, 55763
Offset: 1

Author

Steven M. Altschuld, Dec 14 2019

Keywords

Comments

The author suggests that these numbers be called Double Frogger Primes because two times the distance as the average distance to the nearest neighbor (the log) has to be hopped.

Examples

			P = 211 is a term because 199 + 2*log(211) < 211 < 223 - 2*log(211).
P = 199 is not a term because 197 + 2*log(199) > 199.
		

Crossrefs

Cf. A288908 (with 1*log(P)), A330427 (with 3*log(P)), A330428.

Programs

  • Magma
    f:=func;  [p:p in PrimesUpTo(56000)|f(p)];// Marius A. Burtea, Dec 18 2019
  • Maple
    q:= 3: state:= false: count:= 0: Res:= NULL:
    while count < 100 do
      p:= nextprime(q);
      newstate:= is(p-q > 2*log(q));
      if state and newstate then
        count:= count+1; Res:= Res, q;
      fi;
      q:= p; state:= newstate;
    od:
    Res; # Robert Israel, Dec 18 2019
  • Mathematica
    lst={};Do[a=Prime[n];If[Min[Abs[a-NextPrime[a,{-1,1}]]]>2*Log[a],AppendTo[lst,a]],{n,1,10000}];lst (* Metin Sariyar, Dec 15 2019 *)
    (* Second program: *)
    Select[Prime@ Range[10^4], Min@ Abs[# - NextPrime[#, {-1, 1}]] > 2 Log[#] &] (* Michael De Vlieger, Dec 15 2019 *)

Extensions

More terms from Metin Sariyar, Dec 15 2019

A330428 Smallest prime p such that both nearest primes up and down are farther away than n*log(p).

Original entry on oeis.org

5, 211, 38501, 413353, 10938023, 142414669, 163710121, 8835528511, 31587561361, 343834606051, 1480975873513, 26923643849953
Offset: 1

Author

Steven M. Altschuld, Dec 14 2019

Keywords

Comments

For these numbers, the name "Lowest Frogger Primes" LFP(n) is suggested because (frog) jumps with a length greater than n times the local average are required to bridge the gaps (logs).

Crossrefs

Cf. A288908 (with 1*log(P)), A330426 (with 2*log(P)), A330427 (with 3*log(P)).

Programs

  • PARI
    {my(npp=2,np=3,n=1);forprime(p=5,10^9,my(d=log(p)*n);if(np-npp>d&&p-np>d,print(np,", ");n++);npp=np;np=p)} \\ Hugo Pfoertner, Dec 14 2019

Extensions

a(5)-a(9) from Hugo Pfoertner, Dec 14 2019
a(10) from Hugo Pfoertner, Dec 16 2019
a(11)-a(12) from Giovanni Resta, Dec 19 2019

A330427 Primes P where the nearest prime is greater than 3*log(P) away.

Original entry on oeis.org

38501, 58831, 153191, 203713, 206699, 232259, 247141, 250543, 268343, 279269, 286927, 302053, 330509, 362521, 362801, 404597, 413353, 421559, 430193, 438091, 479081, 479701, 485263, 504727, 512207, 515041, 539573, 539993, 546781, 569369, 574859, 590489, 624917
Offset: 1

Author

Steven M. Altschuld, Dec 14 2019

Keywords

Comments

The author suggests that these numbers be called Triple Frogger Primes because three times the distance as the average distance to the nearest neighbor (the log) has to be hopped.

Crossrefs

Cf. A288908 (with 1*log(P)), A330426 (with 2*log(P)), A330428 (Lowest Frogger Primes).

Programs

  • Magma
    f:=func;  [p:p in PrimesUpTo(630000)|f(p)];// Marius A. Burtea, Dec 18 2019
    
  • Maple
    q:= 3: state:= false: count:= 0: Res:= NULL:
    while count < 100 do
      p:= nextprime(q);
      newstate:= is(p-q > 3*log(q));
      if state and newstate then
        count:= count+1; Res:= Res, q;
      fi;
      q:= p; state:= newstate;
    od:
    Res; # Robert Israel, Dec 18 2019
  • Mathematica
    Select[Prime@ Range[10^5], Min@ Abs[# - NextPrime[#, {-1, 1}]] > 3 Log[#] &] (* Michael De Vlieger, Dec 15 2019 *)
  • PARI
    lista(nn) = {my(x=2, y=3); forprime(p=5, nn, if(min(p-y, y-x)>3*log(y), print1(y, ", ")); x=y; y=p); } \\ Jinyuan Wang, Mar 03 2020

Extensions

More terms from Michael De Vlieger, Dec 15 2019