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 34 results. Next

A269251 a(n) = smallest prime in the sequence s(k) = n*s(k-1) - s(k-2), with s(0) = 1, s(1) = n - 1 (or a(n) = -1 if no such prime exists).

Original entry on oeis.org

-1, -1, 2, 3, 19, 5, 41, 7, 71, 89, 109, 11, 2003, 13, 3121, 239, 271, 17, 729962708557509701, 19, 419, 461, 11593, 23, 599, 11356201, 701, 11546481261621528160662473705515857458665002781273993, 811, 29, 929
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jul 09 2016

Keywords

Comments

For n >= 2, smallest prime of the form (x^y + 1/x^y)/(x + 1/x), where x = (sqrt(n+2) +- sqrt(n-2))/2 and y is an odd positive integer, or -1 if no such prime exists.
If a(34) > 0 then a(34) > 10^1000. - Robert Israel, Feb 06 2018
For detailed theory, see [Hone]. - L. Edson Jeffery, Feb 09 2018
Values of n where a(n) might need more than 1000 digits: 34, 52, 123, 254, 275, 285, 322, 371, 401, 413, 437, 460, 508, 518, 535, 540, 629, 643, 653, 691, 723, 724, 753, 797, 837, 843, 876, 881, 898, 913, 960, 970, 981, 986, 987, ... - Jean-François Alcover, Mar 01 2018

Crossrefs

Programs

  • Magma
    lst:=[]; for n in [1..31] do if n le 2 then Append(~lst, 0); else a:=1; c:=1; repeat b:=n*a-c; c:=a; a:=b; until IsPrime(a); Append(~lst, a); end if; end for; lst;
  • Maple
    f:= proc(n) local a,b,t;
    a:= 1; b:= n-1;
    do
      if isprime(b) then return b fi;
      t:= n*b-a;
      a:= b;
      b:= t;
    od
    end proc:
    f(1):= -1: f(2):= -1:
    map(f, [$1..33]); # Robert Israel, Feb 06 2018
  • Mathematica
    max = 10^1000; a[1] = a[2] = -1; a[n_] := Module[{s}, s[0] = 1; s[1] = n-1; s[k_] := s[k] = n s[k-1] - s[k-2]; For[k = 1, s[k] <= max, k++, If[PrimeQ[s[k]], Return[s[k]]]]] /. Null -> -1; Table[a[n], {n, 1, 33}] (* Jean-François Alcover, Mar 01 2018 *)

Formula

If n is prime then a(n+1) = n.

Extensions

Changed the value for the exceptional case from 0 to -1 for consistency with other sequences. - N. J. A. Sloane, Jan 19 2018

A269252 Define a sequence by s(k) = n*s(k-1) - s(k-2), with s(0) = 1, s(1) = n - 1. a(n) is the smallest index k such that s(k) is prime, or -1 if no such k exists.

Original entry on oeis.org

-1, -1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 3, 2, 2, 1, 14, 1, 2, 2, 3, 1, 2, 5, 2, 36, 2, 1, 2, 1, 15, -1, 6, 2, 3, 1, 2, 2, 6, 1, 3, 1, 2, 2, 2, 1, 2, 3, 2, -1, 3, 1, 2, 2, 2, 6, 3, 1, 2, 1, 30, 3, 2, 2, 2, 1, 2, 5, 2, 1, 5, 1, 6, 3, 2, 6, 3, 1, 8, 6, 14, 1, 3
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jul 09 2016

Keywords

Comments

For n >= 2, positive integer k yielding the smallest prime of the form (x^y + 1/x^y)/(x + 1/x), where x = (sqrt(n+2) +/- sqrt(n-2))/2 and y = 2*k + 1, or -1 if no such k exists.
Every positive term belongs to A005097.
For detailed theory, see [Hone]. - L. Edson Jeffery, Feb 09 2018

Examples

			Let b(k) be the recursive sequence defined by the initial conditions b(0) = 1, b(1) = 10, and the recursive equation b(k) = 11*b(k-1) - b(k-2). a(11) = 2 because b(2) = 109 is the smallest prime in b(k).
Let c(k) be the recursive sequence defined by the initial conditions c(0) = 1, c(1) = 12, and the recursive equation c(k) = 13*c(k-1) - c(k-2). a(13) = 3 because c(3) = 2003 is the smallest prime in c(k).
		

Crossrefs

Programs

  • Magma
    lst:=[]; for n in [1..85] do if n in [1, 2, 34, 52] then Append(~lst, -1); else a:=1; c:=1; t:=0; repeat b:=n*a-c; c:=a; a:=b; t+:=1; until IsPrime(a); Append(~lst, t); end if; end for; lst;
  • Mathematica
    s[k_, m_] := s[k, m] = Which[k == 0, 1, k == 1, 1 + m, True, m s[k - 1, m] - s[k - 2, m]]; Table[SelectFirst[Range[120], PrimeQ@ Abs@ s[#, -n] &] /. k_ /; MissingQ@ k -> -1, {n, 85}] (* Michael De Vlieger, Feb 03 2018 *)

Formula

If n is prime then a(n+1) = 1.

A086397 Numerators of the rational convergents to sqrt(2) if both numerators and denominators are primes.

Original entry on oeis.org

3, 7, 41, 63018038201, 19175002942688032928599
Offset: 1

Views

Author

Cino Hilliard, Sep 06 2003

Keywords

Comments

Next term, if it exists, is bigger than 489 digits (the 1279th convergent to sqrt(2)). - Joshua Zucker, May 08 2006
Are the terms >= 7 the primes in A183064? Is this a subsequence of A088165? - R. J. Mathar, Aug 16 2019
Yes, the terms >= 7 are the primes in A183064 and are a subsequence of A088165. a(1)=3 is from the numerator of 3/2, but no other convergents > sqrt(2) can appear in this sequence because they all have even denominator. All terms >= 7 are lower principal convergents from A002315/A088165/A183064 - Martin Fuller, Apr 08 2023

Crossrefs

Denominators are A118612.

Programs

  • Mathematica
    For[n = 2, n < 1500, n++, a := Join[{1}, Table[2, {i, 2, n}]]; If[PrimeQ[Denominator[FromContinuedFraction[a]]], If[PrimeQ[Numerator[FromContinuedFraction[a]]], Print[Numerator[FromContinuedFraction[a]]]]]] (* Stefan Steinerberger, May 09 2006 *)
  • PARI
    cfracnumdenomprime(m,f) = { default(realprecision,3000); cf = vector(m+10); x=f; for(n=0,m, i=floor(x); x=1/(x-i); cf[n+1] = i; ); for(m1=0,m, r=cf[m1+1]; forstep(n=m1,1,-1, r = 1/r; r+=cf[n]; ); numer=numerator(r); denom=denominator(r); if(ispseudoprime(numer)&&ispseudoprime(denom), print1(numer",");numer2=numer;denom2=denom); ) default(realprecision,28); }

Extensions

More terms from Cino Hilliard, Jan 15 2005
Edited by N. J. A. Sloane, Aug 06 2009 at the suggestion of R. J. Mathar

A005850 Primes p such that the NSW number A002315((p-1)/2) is prime.

Original entry on oeis.org

3, 5, 7, 19, 29, 47, 59, 163, 257, 421, 937, 947, 1493, 1901, 6689, 8087, 9679, 28753, 79043, 129127, 145969, 165799, 168677, 170413, 172243
Offset: 1

Views

Author

Keywords

Comments

Some of the larger entries may only correspond to probable primes.

References

  • Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 290.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 248.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A099088 is a closely related sequence.

Programs

  • Mathematica
    max = 10000 (* computation is very slow beyond this limit *); nc = Numerator[Convergents[Sqrt[2], max]]; Reap[Do[If[PrimeQ[n], If[PrimeQ[nc[[n]]], Print[n]; Sow[n]]] , {n, 3, max}]][[2, 1]] (* Jean-François Alcover, Oct 22 2012, after David Applegate *)
  • PARI
    is(n)=my(w=3+quadgen(32)); isprime(n) && n>2 && ispseudoprime(imag((1+w)*w^(n\2))) \\ Charles R Greathouse IV, Oct 19 2012

Formula

A088165(n) mod a(n) = 1. - Altug Alkan, Mar 17 2016

Extensions

6689, 8087, 9679 reported by Warut Roonguthai on the PrimeForm mailing list.
28753 found by Andrew Walker (ajw01(AT)uow.edu.au), Jul 12 2001.
129127, 145969, 165799, 168677, 170413, 172243 found by Eric W. Weisstein, May 22 2006 - Jan 25 2007 [from Mike Oakes, Mar 29 2009]

A239941 Primes p which are floor of Root-mean-cube (RMC) of prime(n), prime(n+1) and prime(n+2).

Original entry on oeis.org

7, 53, 89, 223, 257, 1097, 6823, 10181, 12149, 14783, 15527, 20063, 22027, 29917, 30539, 40519, 42491, 43261, 50543, 51511, 57727, 65063, 68639, 72103, 97453, 99391, 100693, 108463, 108893, 110281, 111581, 113363, 116719, 149623, 153407, 154211, 155821, 193057
Offset: 1

Views

Author

K. D. Bajpai, Apr 03 2014

Keywords

Examples

			11, 13 and 17 are consecutive primes: sqrt(( 11^3 + 13^3 + 17^3)/3) = 53.044...: floor(53.044...) = 53, which is prime and appears in the sequence.
31, 37 and 41 are consecutive primes: sqrt(( 31^3 + 37^3 + 41^3)/3) = 223.13...: floor(223.13...) = 223, which is prime and appears in the sequence.
		

Crossrefs

Programs

  • Maple
    select(isprime, {seq(floor(sqrt(add(ithprime(n+i)^3, i=0..2)/3)), n=1..1000)})[]; # corrected by Georg Fischer, Sep 27 2024

A240339 Primes p which are floor of Root-Mean-Cube (RMC) of prime(n) and prime(n+1).

Original entry on oeis.org

59, 97, 1321, 1621, 2539, 3511, 4339, 4889, 5591, 6491, 6917, 9419, 10289, 11689, 16381, 18719, 19441, 23053, 23567, 28499, 41051, 47143, 64661, 65203, 67939, 71023, 82493, 89107, 94999, 98927, 106087, 114941, 117281, 120823, 135647, 139361, 144289, 154799
Offset: 1

Views

Author

K. D. Bajpai, Apr 04 2014

Keywords

Examples

			13 and 17 are consecutive primes: sqrt((13^3 + 17^3)/2) = 59.62382073: floor(59.62382073)= 59, which is prime and appears in the sequence.
19 and 23 are consecutive primes: sqrt((19^3 + 23^3)/2) = 97.53460923: floor(97.53460923)= 97, which is prime and appears in the sequence.
		

Crossrefs

Programs

  • Maple
    select(isprime, {seq(floor(sqrt((ithprime(n)^3 + ithprime(n+1)^3)/2)),n=1..1000)}); # corrected by Georg Fischer, Sep 27 2024
  • Mathematica
    Select[Floor[Sqrt[Mean[#]]]&/@(Partition[Prime[Range[600]],2,1]^3), PrimeQ] (* Harvey P. Dale, Sep 24 2014 *)

A257553 Primes whose squares are not the sums of two consecutive nonsquares.

Original entry on oeis.org

2, 3, 7, 17, 41, 239, 577, 665857, 9369319, 63018038201, 489133282872437279, 19175002942688032928599, 123426017006182806728593424683999798008235734137469123231828679
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 29 2015

Keywords

Comments

Primes of the form A257282(k).
2 is in this sequence, and an odd prime p is in the sequence iff either (p^2 - 1)/2 or (p^2 + 1)/2 is a square. - Wolfdieter Lang, May 07 2015
According to the Neretin comment in A257282, and as the primes of A001333 are in A086395, this is (apart from the 2) the same as A086395. - R. J. Mathar, Jan 31 2024

Examples

			2 is in the sequence because it is prime and its square 4 is in A256944: 4 is not a sum of consecutive numbers.
3 is in the sequence because it is prime and its square 9 is in A256944: 9 = 2^2 + 5.
7 is in the sequence because it is prime and its square 49 is in A256944: 49 = 24 + 5^2.
5 is not in the sequence because neither 12 nor 13 is a square.
		

Crossrefs

Programs

  • Mathematica
    lim = 1000000; s = Plus @@@ (Partition[#, 2, 1] & @ Complement[Range@ lim, Range[Floor@ Sqrt[lim]]^2]); Select[Sqrt[#] & /@ Select[Range@ Floor[Sqrt[lim]]^2, ! MemberQ[s, #] &] , PrimeQ] (* Michael De Vlieger, Apr 29 2015 *)

Extensions

Name clarified by Michael De Vlieger and Jon E. Schoenfield, May 03 2015
Edited by Wolfdieter Lang, May 07 2015

A383734 Numbers k such that 2+k and 2*k are squares.

Original entry on oeis.org

2, 98, 3362, 114242, 3880898, 131836322, 4478554082, 152139002498, 5168247530882, 175568277047522, 5964153172084898, 202605639573839042, 6882627592338442562, 233806732499933208098, 7942546277405390632802, 269812766699283348307202, 9165691521498228451812098
Offset: 1

Views

Author

Emilio Martín, May 07 2025

Keywords

Comments

The limit of a(n+1)/a(n) is 33.97056... = 17+12*sqrt(2) = (3+2*sqrt(2))^2 (see A156164).

Examples

			98 is a term becouse 98+2=100 is a square and 98*2=196 is a square.
		

Crossrefs

Cf. A382209 (10+k and 10*k are squares).
Cf. A245226 (m such that k+m and k*m are squares).

Programs

  • Mathematica
    LinearRecurrence[{35, -35, 1}, {2, 98, 3362}, 20] (* Amiram Eldar, May 07 2025 *)
  • Python
    from itertools import islice
    def A383734_gen(): # generator of terms
        x, y = 1, 7
        while True:
            yield 2*x**2
            x, y = y, 6*y - x
    A383734_list = list(islice(A383734_gen(), 100))

Formula

a(n) = (1/2) * ((3+2*sqrt(2))^(2*n-1) + (3-2*sqrt(2))^(1-2*n)) - 1.
a(n) = -2*sqrt(2)*sinh(n*log(17+12*sqrt(2))) + 3*cosh(n*log(17+12*sqrt(2))) - 1.
a(n) = 2*A002315(n-1)^2.
a(n) = A075870(n)^2 - 2.
a(n) = 34*a(n-1) - a(n-2) + 32.
G.f.: 2 * (1 + 14*x + x^2) / ((1 - x)*(1 - 34*x + x^2)). - Stefano Spezia, May 08 2025

A143822 Primes p such that sigma_0((p*p + 1)/2) = 4.

Original entry on oeis.org

13, 17, 23, 31, 37, 53, 67, 89, 97, 103, 109, 113, 127, 137, 149, 151, 163, 167, 179, 197, 211, 223, 227, 229, 241, 263, 269, 277, 281, 283, 311, 331, 347, 359, 367, 373, 383, 389, 397, 419, 431, 433, 439, 479, 491, 503, 509, 541, 547, 587, 601, 617, 619, 653
Offset: 1

Views

Author

Ctibor O. Zizka, Sep 02 2008

Keywords

Comments

A048161 are primes p such that sigma_0((p*p+1)/2)= 2. Primes p such that sigma_0((p*p+1)/2)= 3 gives all RMS numbers (A140480) with 2 divisors (prime RMS numbers, prime NSW numbers (A088165)) and all RMS numbers with 4 divisors as those are a multiple of two nonequal RMS prime numbers. In general we look after primes p such that sigma_0((p*p+1)/2) equals some given integer k. RMS numbers n=p_1*...*p_t have k=2^t divisors (p_i prime, t integer >=1) and sigma_2(p_1*...*p_t)=(2^t)* (q_1^r_1 *...* q_t^r_t), q_j prime, r_t integer >=1.

Crossrefs

Programs

  • Maple
    A066885 := proc(n) local p; p :=ithprime(n) ; (p^2+1)/2 ; end: A000005 := proc(n) numtheory[tau](n) ; end: for n from 2 to 300 do if A000005(A066885(n)) = 4 then printf("%d,",ithprime(n)) ; fi; od: # R. J. Mathar, Sep 04 2008
  • Mathematica
    Select[Range[650], PrimeQ[#] && DivisorSigma[0, (#^2 + 1)/2] == 4 &] (* Amiram Eldar, Mar 11 2020 *)
    Select[Prime[Range[150]],DivisorSigma[0,(#^2+1)/2]==4&] (* Harvey P. Dale, Sep 22 2022 *)

Extensions

97 inserted and extended by R. J. Mathar, Sep 04 2008

A158287 Composite RMS numbers: composite numbers c such that root mean square of divisors of c is an integer.

Original entry on oeis.org

287, 1673, 3055, 6665, 9545, 9799, 9855, 21385, 26095, 34697, 46655, 66815, 68593, 68985, 125255, 155287, 182665, 242879, 273265, 380511, 391345, 404055, 421655, 627215, 730145, 814463, 823537, 876785, 1069895, 1087009, 1166399, 1204281, 1256489, 1289441
Offset: 1

Views

Author

Jaroslav Krizek, Mar 15 2009

Keywords

Comments

a(n) = composite number c (A002808), iff sqrt(sigma_2(c)/tau(c)) = sqrt(A001157(c)/A000005(c)) = k, for k = natural numbers (A000027). Prime RMS numbers (NSW primes) in A088165.
16 of the first 1654 terms are even (the smallest is 2217231104). The first 16 even terms are all divisible by 30976. - Donovan Johnson, Apr 17 2013

Examples

			a(1) = 287, sqrt(A001157(287)/A000005(287)) = sqrt(84100/4) = 145, number 145 is an integer.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[13*10^5],CompositeQ[#]&&IntegerQ[RootMeanSquare[Divisors[ #]]]&] (* Harvey P. Dale, Sep 23 2022 *)
Previous Showing 21-30 of 34 results. Next