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.

Previous Showing 21-30 of 33 results. Next

A291437 Smallest m >= 0 such that (2*n)*3^m + 1 is prime, or -1 if no such value exists.

Original entry on oeis.org

0, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 4, 0, 0, 2, 0, 2, 1, 0, 1, 9, 0, 0, 4, 1, 0, 2, 0, 0, 1, 1, 0, 1, 0, 2, 4, 0, 1, 1, 1, 0, 2, 0, 0, 1, 0, 0, 1, 0, 3, 1, 2, 4, 1, 1, 0, 2, 0, 1, 5, 0, 0, 1, 2, 1, 1, 0, 0, 1, 1, 0, 2, 80, 0, 6, 0, 8, 2, 0, 1
Offset: 1

Views

Author

Martin Renner, Aug 23 2017

Keywords

Comments

There exist even integers 2*n such that (2*n)*3^m + 1 is always composite.
It is conjectured that the smallest one is 125050976086 = A123159(3), therefore a(62525488043) = -1.
For the corresponding primes see A291438.
a(A005097(n)) = 0 and a(A047845(n+1)) > 0 (or = -1).

Examples

			a(4) = 2 because this is the smallest value such that 8*3^2 + 1 = 73 is prime, since 8*3^0 + 1 = 9 and 8*3^1 + 1 = 25 are not prime.
		

Crossrefs

Programs

  • Maple
    a:=[]:
    for n from 1 to 10^3 do
      t:=-1:
      for m from 0 to 10^3 do # this max value of m is sufficient up to n=10^3
        if isprime((2*n)*3^m+1) then t:=m: break: fi:
      od:
      a:=[op(a),t]:
    od:
    a;
  • Mathematica
    Table[SelectFirst[Range[0, 10^3], PrimeQ[2 n*3^# + 1] &] /. k_ /; MissingQ@ k -> -1, {n, 104}] (* Michael De Vlieger, Aug 23 2017 *)
  • PARI
    a(n) = {my(m = 0); while (!isprime(p=(2*n)*3^m + 1), m++); m;} \\ Michel Marcus, Aug 25 2017

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

Views

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,

A380549 List of numbers of the form i + 3*j + 4*i*j for i, j >= 1.

Original entry on oeis.org

8, 13, 15, 18, 22, 23, 24, 28, 29, 33, 35, 36, 38, 42, 43, 46, 48, 50, 51, 53, 57, 58, 60, 61, 63, 64, 68, 69, 71, 73, 74, 78, 79, 80, 83, 85, 87, 88, 90, 92, 93, 96, 97, 98, 99, 100, 101, 103, 105, 106, 108, 112, 113, 114, 118, 120, 123, 126, 127, 128, 131, 132, 133, 134, 137, 138, 139, 141, 143, 145, 148, 150
Offset: 1

Views

Author

Peter Bala, Jan 26 2025

Keywords

Comments

This is a companion sequence to A380509. If N != 6 is a positive integer not in this list then 4*N + 3 is either a prime or three times a prime. See A380550.
Compare with A072668, numbers of the form i + j + i*j, and A047845, numbers of the form i + j + 2*i*j.

Crossrefs

Programs

  • Maple
    L := 150:  S := {}:
    for i from 1 to L do
      for j from 1 to L do
        if i + 3*j + 4*i*j <= L then S := `union`(S, {i+3*j+4*i*j}) end if
      end do;
    end do:
    S;

A117092 Numbers n such that nextprime(2*n) > 2*nextprime(n) (here nextprime = A007918; if p is prime then nextprime(p) = p).

Original entry on oeis.org

2, 3, 4, 5, 7, 10, 11, 12, 13, 16, 17, 19, 22, 23, 27, 28, 29, 31, 37, 40, 41, 42, 43, 45, 46, 47, 52, 53, 57, 58, 59, 60, 61, 66, 67, 70, 71, 72, 73, 79, 82, 83, 87, 88, 89, 97, 100, 101, 102, 103, 106, 107, 108, 109, 112, 113, 126, 127, 129, 130, 131, 136
Offset: 1

Views

Author

Mohammed Bouayoun (mohammed.bouayoun(AT)sanef.com), Apr 18 2006

Keywords

Comments

Contains all primes (A000040), and the intersection of A006093 and A047845. - Robert Israel, Mar 30 2016

Examples

			nextprime(2*12)=29 and nextprime(2)*nextprime(12)=2*13 then 12 is member because 29>26.
		

Crossrefs

Programs

  • Maple
    select(t -> nextprime(2*t) > 2*nextprime(t-1),[$1..100]); # Robert Israel, Mar 30 2016
  • Mathematica
    Select[Range@100, NextPrime[2 #] > 2 NextPrime[# - 1] &] (* Ivan Neretin, Mar 30 2016 *)
  • PARI
    for(i=1,100,if(nextprime(2*i)
    				

Extensions

Corrected by T. D. Noe, Oct 25 2006

A166160 a(n) = (n-th odd prime + n-th odd nonprime)/2 - 1.

Original entry on oeis.org

1, 6, 10, 15, 18, 21, 25, 28, 33, 37, 42, 45, 48, 51, 57, 61, 64, 70, 73, 76, 81, 84, 89, 94, 97, 100, 105, 109, 113, 121, 124, 128, 130, 136, 139, 144, 148, 153, 157, 161, 163, 171, 173, 177, 179, 187, 195, 198, 201, 204, 210, 212, 218, 222, 228, 234, 236, 240, 243
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 09 2009

Keywords

Crossrefs

Programs

  • Maple
    A065091 := proc(n) ithprime(n+1) ; end proc:
    A014076 := proc(n) if n = 1 then 1; else for a from procname(n-1)+2 by 2 do if not isprime(a) then return a ; end if; end do: end if; end proc:
    A166160 := proc(n) (A065091(n)+A014076(n))/2-1 ; end proc: seq(A166160(n),n=1..120) ; # R. J. Mathar, May 21 2010
  • Mathematica
    A014076 := Select[Range@250, ! PrimeQ@# && OddQ@# &]; A166160 := Prime[Range[2, 150]]; Table[(A166160[[n]] + A014076[[n]])/2 - 1, {n, 1, 50}] (* G. C. Greubel, Sep 17 2017 *)
    Module[{nn=250,op,onp},op=Prime[Range[2,nn]];onp=Select[Range[1,nn,2],!PrimeQ[#]&];Total[#]/2-1&/@Thread[{Take[op,Length[ onp]],onp}]] (* Harvey P. Dale, Mar 02 2025 *)

Formula

a(n) = A005097(n) + A047845(n), where A005097 U A047845 = A001477.
a(n) = (A065091(n) + A014076(n))/2 - 1.

Extensions

Entries checked by R. J. Mathar, May 21 2010

A211173 (2n)!^n (modulo 2n+1).

Original entry on oeis.org

0, 2, 1, 6, 0, 10, 1, 0, 1, 18, 0, 22, 0, 0, 1, 30, 0, 0, 1, 0, 1, 42, 0, 46, 0, 0, 1, 0, 0, 58, 1, 0, 0, 66, 0, 70, 1, 0, 0, 78, 0, 82, 0, 0, 1, 0, 0, 0, 1, 0, 1, 102, 0, 106, 1, 0, 1, 0, 0, 0, 0, 0, 0, 126, 0, 130, 0, 0, 1, 138, 0
Offset: 0

Views

Author

Larry Riddle (LRiddle(AT)AgnesScott.edu) and Robert G. Wilson v, Jan 31 2013

Keywords

Comments

a(n)= 0, 1 or 2n. In fact, a(n) = 0 iff n belongs to A047845, a(n) = 1 iff n belongs to A104636 and a(n) = 2n iff n belongs to A104635.

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[((2 n)!)^n, 2 n + 1]; Array[f, 70]
    Table[PowerMod[(2n)!,n,2n+1],{n,0,70}] (* Harvey P. Dale, Nov 02 2019 *)
  • PARI
    a(n)=if(isprime(2*n+1),if(n%2,2*n,1),0) \\ Charles R Greathouse IV, Feb 07 2013

Formula

a(n) = (2n)!^n (modulo 2n+1).

A277870 Ordered number of unit edges needed to build every 4-orthotope from hypercubes.

Original entry on oeis.org

32, 52, 72, 84, 92, 112, 116, 132, 135, 148, 152, 160, 172, 180, 186, 192, 204, 212, 216, 232, 237, 244, 248, 252, 256, 260, 272, 276, 288, 292, 297, 308, 312, 316, 326, 332, 336, 339, 340, 352, 372, 378, 380, 384, 390, 392, 396, 404, 408, 412, 415, 424, 428
Offset: 1

Views

Author

Eric R. Carter, Nov 02 2016

Keywords

Comments

Ordered number of edges required to construct every hyperrectangle as a union of unit hypercubes. The sequence gives the n-th smallest such number, and generalizes the two-dimensional A047845 and the three-dimensional A090767 to four dimensions.
Does a(n) ~ n? - Charles R Greathouse IV, Nov 06 2016

Examples

			a(1)=32 as this is the number of edges in the unit hypercube.
		

Crossrefs

Programs

  • Mathematica
    Edges[x_,y_,z_,w_]:=(4*x*y*z*w)+3*((w*x*z)+(w*y*z)+(w*x*y)+(x*y*z))+2*((w*x)+(w*y)+(w*z)+(x*y)+(x*z)+(y*z))+x+y+z+w;inputs=Tuples[Range[s],4];Union[Table[Edges[inputs[[k]][[1]],inputs[[k]][[2]],inputs[[k]][[3]],inputs[[k]][[4]]],{k,1,Length[inputs]}]]
    Accuracy to 170 terms is achieved for s>=5764801, and for the entire list in the limit as s approaches infinity.
  • PARI
    list(lim)=my(v=List()); for(w=1,(lim-12)\20, for(x=1, min((lim-8*w-4)\(12*w+8),w), for(y=1,min((lim-5*w*x-3*x-3*w-1)\(7*w*x+5*x+5*w+3),x), forstep(n=((7*w+5)*y+(5*w+3))*x+(5*w + 3)*y+3*w+1, lim, ((4*w+3)*y+3*w+2)*x+(3*w+2)*y+2*w+1, listput(v,n))))); Set(v) \\ Charles R Greathouse IV, Nov 05 2016

Formula

These numbers are of the form: 4wxyz + 3(wxz+wyz+wxy+xyz) + 2(wx+wy+wz+xy+xz+yz) + w+x+y+z for any positive integers w, x, y, z.

A286982 Smallest nonnegative k such that (1 + k)^(2^n) + k is not prime and all (1 + k)^(2^j) + k, for 0 <= j < n, are primes.

Original entry on oeis.org

6, 3, 5, 2, 1, 54131988
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 12 2017

Keywords

Examples

			a(1) = 6 because (1 + 6)^(2^1) + 6 = 55 is semiprime and (1 + 6)^(2^0) + 6 = 13 is prime;
a(2) = 3 because (1 + 3)^(2^2) + 3 = 259 is semiprime and both (1 + 3)^(2^0) + 3 = 7 and (1 + 3)^(2^1) + 3 = 19 are primes;
a(3) = 5 because (1 + 5)^(2^3) + 5 = 167921 is semiprime and (1 + 5)^(2^0) + 5 = 11, (1 + 5)^(2^1) + 5 = 41 and (1 + 5)^(2^2) + 5 = 1301 are all primes;
a(4) = 2 because (1 + 2)^(2^4) + 2 = 43046723 is semiprime and (1 + 2)^(2^0) + 2 = 5, (1 + 2)^(2^1) + 2 = 11, (1 + 2)^(2^2) + 2 = 83 and (1 + 2)^(2^3) + 2 = 6563 are all primes;
a(5) = 1 because (1 + 1)^(2^5) + 1 = 4294967297 is semiprime and (1 + 1)^(2^0) + 1 = 3, (1 + 1)^(2^1) + 1 = 5, (1 + 1)^(2^2) + 1 = 17, (1 + 1)^(2^3) + 1 = 257 and (1 + 1)^(2^4) + 1 = 65537 are fix known Fermat primes (A019434);
a(6) = 54131988 because (1 + 54131988)^(2^6) + 54131988 is composite and (1 + 54131988)^(2^0) + 54131988 = 108263977, (1 + 54131988)^(2^1) + 54131988 = 2930272287228109, (1 + 54131988)^(2^2) + 54131988 =  8586495360054127683625679378629, (1 + 54131988)^(2^3) + 54131988 = 73727902568231063808600888120898279950965368674840612135914869, (1 + 54131988)^(2^4) + 54131988 and (1 + 54131988)^(2^5) + 54131988 are all primes.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k = 1}, While[PrimeQ[(1 + k)^(2^n) + k] || ! AllTrue[(1 + k)^(2^Range[0, n-1]) + k, PrimeQ], k++]; k]; Array[a, 5] (* Giovanni Resta, May 30 2017 *)

Extensions

a(6) from Robert G. Wilson v, May 14 2017

A306353 Number of composites among the first n composite numbers whose least prime factor p is that of the n-th composite number.

Original entry on oeis.org

1, 2, 3, 1, 4, 5, 6, 2, 7, 8, 9, 3, 10, 11, 1, 12, 4, 13, 14, 15, 5, 16, 2, 17, 18, 6, 19, 20, 21, 7, 22, 23, 1, 24, 8, 25, 26, 3, 27, 9, 28, 29, 30, 10, 31, 4, 32, 33, 11, 34, 35, 36, 12, 37, 2, 38, 39, 13, 40, 41, 5, 42, 14, 43, 44, 3, 45, 15, 46, 6, 47, 48, 16, 49, 50, 51, 17, 52, 53, 54, 18, 55, 56, 7
Offset: 1

Views

Author

Jamie Morken and Vincenzo Librandi, Feb 09 2019

Keywords

Comments

Composites with least prime factor p are on that row of A083140 which begins with p
Sequence with similar values: A122005.
Sequence written as a jagged array A with new row when a(n) > a(n+1):
1, 2, 3,
1, 4, 5, 6,
2, 7, 8, 9,
3, 10, 11,
1, 12,
4, 13, 14, 15,
5, 16,
2, 17, 18,
6, 19, 20, 21,
7, 22, 23,
1, 24,
8, 25, 26,
3, 27,
9, 28, 29, 30.
A153196 is the list B of the first values in successive rows with length 4.
B is given by the formula for A002808(x)=A256388(n+3), an(x)=A153196(n+2)
For example: A002808(26)=A256388(3+3), an(26)=A153196(3+2).
A243811 is the list of the second values in successive rows with length 4.
A047845 is the list of values in the second column and A104279 is the list of values in the third column of the jagged array starting on the second row.
Sequence written as an irregular triangle C with new row when a(n)=1:
1,2,3,
1,4,5,6,2,7,8,9,3,10,11,
1,12,4,13,14,15,5,16,2,17,18,6,19,20,21,7,22,23,
1,24,8,25,26,3,27,9,28,29,30,10,31,4,32,33,11,34,35,36,12,37,2,38,39,13,40,41,5,42,14,43,44,3,45,15,46,6,47,48,16,49,50,51,17,52,53,54,18,55,56,7,57,19,58,4,59.
A243887 is the last value in each row of C.
The second value D on the row n > 1 of the irregular triangle C is a(A053683(n)) or equivalently A084921(n). For example for row 3 of the irregular triangle:
D = a(A053683(3)) = a(16) = 12 or D = A084921(3) = 12. This is the number of composites < A066872(3) with the same least prime factor p as the A053683(3) = 16th composite, A066872(3) = 26.
The number of values in each row of the irregular triangle C begins: 3,11,18,57,39,98,61,141,265,104,351,268,...
The second row of the irregular triangle C is A117385(b) for 3 < b < 15.
The third row of the irregular triangle C has similar values as A117385 in different order.

Examples

			First composite 4, least prime factor is 2, first case for 2 so a(1)=1.
Next composite 6, least prime factor is 2, second case for 2 so a(2)=2.
Next composite 8, least prime factor is 2, third case for 2 so a(3)=3.
Next composite 9, least prime factor is 3, first case for 3 so a(4)=1.
Next composite 10, least prime factor is 2, fourth case for 2 so a(5)=4.
		

Crossrefs

Programs

  • Mathematica
    counts = {}
    values = {}
    For[i = 2, i < 130, i = i + 1,
    If[PrimeQ[i], ,
    x = PrimePi[FactorInteger[i][[1, 1]]];
      If[Length[counts] >= x,
       counts[[x]] = counts[[x]] + 1;
       AppendTo[values, counts[[x]]], AppendTo[counts, 1];
       AppendTo[values, 1]]]]
       (* Print[counts] *)
       Print[values]
  • PARI
    c(n) = for(k=0, primepi(n), isprime(n++)&&k--); n; \\ A002808
    a(n) = my(c=c(n), lpf = vecmin(factor(c)[,1]), nb=0); for(k=2, c, if (!isprime(k) && vecmin(factor(k)[,1])==lpf, nb++)); nb; \\ Michel Marcus, Feb 10 2019

Formula

a(n) is approximately equal to A002808(n)*(A038110(x)/A038111(x)), with A000040(x)=A020639(A002808(n)).
For example if n=325, a(325)~= A002808(325)*(A038110(2)/A038111(2)) with A000040(2)=A020639(A002808(325)).
This gives an estimate of 67.499... and the actual value of a(n)=67.

A121206 a(n) = (2n)! mod n(2n+1).

Original entry on oeis.org

2, 4, 6, 0, 10, 12, 0, 16, 18, 0, 22, 0, 0, 28, 30, 0, 0, 36, 0, 40, 42, 0, 46, 0, 0, 52, 0, 0, 58, 60, 0, 0, 66, 0, 70, 72, 0, 0, 78, 0, 82, 0, 0, 88, 0, 0, 0, 96, 0, 100, 102, 0, 106, 108, 0, 112, 0, 0, 0, 0, 0, 0, 126, 0, 130, 0, 0, 136, 138, 0, 0, 0, 0, 148, 150, 0, 0, 156, 0, 0, 162
Offset: 1

Views

Author

Ben Paul Thurston, Aug 20 2006

Keywords

Comments

If the zeros are removed and a 3 is inserted at the front, the first 3000 terms (or more) of the condensed sequence coincide with A039915. - R. J. Mathar, Mar 02 2007

Examples

			a(4) = 0 because 8*7*6*5*4*3*2*1 / 8+7+6+5+4+3+2+1 divides evenly (0 remainder).
		

Crossrefs

Cf. A005097 gives indices of nonzero terms; A047845 gives indices of zero terms.

Programs

  • Mathematica
    Table[Mod[(2n)!, n*(2n + 1)], {n, 85}] (* Ray Chandler, Aug 23 2006 *)

Formula

a(n) = A000142(2n) mod A000217(2n).

Extensions

Edited, corrected and extended by R. J. Mathar and Ray Chandler, Aug 23 2006
Previous Showing 21-30 of 33 results. Next