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 11-17 of 17 results.

A096496 Number of distinct primes in the periodic part of the continued fraction for sqrt(prime(n)).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jun 29 2004

Keywords

Examples

			n=31: prime(31) = 127, and the periodic part of the continued fraction of sqrt(127) is {3,1,2,2,7,11,7,2,2,1,3,22}, so a(31) = 4.
		

Crossrefs

Programs

  • Mathematica
    {te=Table[0, {m}], u=1}; Do[s=Count[PrimeQ[Union[Last[ContinuedFraction[f[n]^(1/2)]]]], True]; te[[u]]=s;u=u+1, {n, 1, m}];te
    Count[Union[ContinuedFraction[Sqrt[#]][[2]]],?PrimeQ]&/@Prime[ Range[ 110]] (* _Harvey P. Dale, Apr 27 2016 *)

A130272 Primes p for which the period of the continued fraction of sqrt(p) increases.

Original entry on oeis.org

2, 3, 7, 13, 19, 31, 43, 61, 103, 109, 139, 151, 181, 211, 331, 421, 541, 571, 631, 751, 919, 1291, 1381, 1549, 1579, 1621, 1759, 1831, 2011, 2311, 2671, 3019, 3469, 3691, 3931, 4909, 4951, 4999, 5119, 6211, 6451, 6679, 8269, 8719, 8779, 8941, 9739, 9949
Offset: 1

Views

Author

T. D. Noe, May 19 2007

Keywords

Crossrefs

Programs

  • Mathematica
    mx=0; n=0; t=Table[n++; While[p=Prime[n]; len=Length[Last[ContinuedFraction[Sqrt[p]]]]; len<=mx, n++ ]; mx=len; p, {50}]

Formula

Where records occur in A054269.

A098033 Parity of p*(p+1)/2 for n-th prime p.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 1

Views

Author

Jeremy Gardiner, Sep 10 2004

Keywords

Comments

The following sequences (possibly with a different offset for first term) all appear to have the same parity: A034953 = triangular numbers with prime indices; A054269 = length of period of continued fraction for sqrt(p), p prime; A082749 = difference between the sum of the next prime(n) natural numbers and the sum of the next n primes; A006254 = numbers n such that 2n-1 is prime; A067076 = numbers n such that 2n+3 is a prime.
Analogous to the prime race (mod 3). - Robert G. Wilson v, Sep 17 2004
See also A089253 = 2n-5 is a prime.
For n > 1, if A000040(n) == 1 (mod 4), then a(n) = 1, otherwise a(n)=0, so (for n>1) also a(n) = number of representations of A000040(n) as a difference of hexagonal numbers (A000384) (cf. [Nyblom, p. 262]). - L. Edson Jeffery, Feb 16 2013

Examples

			a(1) = parity of (2*(2+1)/2 = 3) = 1 (odd).
		

Crossrefs

Programs

Formula

a(n) = parity of p*(p+1)/2 for n-th prime p.
a(n) = 1 - A100672(n), n > 1. - Steven G. Johnson (stevenj(AT)math.mit.edu), Sep 18 2008
For n > 1, a(n) = (prime(n) mod 4) mod 3. - Gary Detlefs, Oct 27 2011

Extensions

More terms from Robert G. Wilson v, Sep 17 2004

A160973 a(n) is the number of positive integers of the form (n-3k)/(2k+1), 1 <= k <= (n-1)/5.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Jun 01 2009, Jun 07 2009

Keywords

Comments

If n is different from 3, then a(n)=0 iff n is in A067076, i.e., 2n+3 is prime.

Crossrefs

Programs

  • Mathematica
    a[n_] := Length[Select[Range[Floor[(n-1)/5]], IntegerQ[(n-3#)/(2#+1)] &]]; Array[a, 100, 0] (* Amiram Eldar, Dec 15 2018 *)
  • PARI
    a(n) = sum(k=1, (n-1)/5, frac((n-3*k)/(2*k+1)) == 0); \\ Michel Marcus, Dec 15 2018

Extensions

Edited by N. J. A. Sloane, Jun 07 2009
a(44) corrected and more terms from Michel Marcus, Dec 15 2018

A161116 a(n) is the number of nontrivial positive divisors of 2n+3.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 2, 0, 0, 2, 0, 1, 2, 0, 0, 2, 2, 0, 2, 0, 0, 4, 0, 1, 2, 0, 2, 2, 0, 0, 4, 2, 0, 2, 0, 0, 4, 2, 0, 3, 0, 2, 2, 0, 2, 2, 2, 0, 4, 0, 0, 6, 0, 0, 2, 0, 2, 4, 2, 1, 2, 2, 0, 2, 0, 2, 6, 0, 0, 2, 2, 2, 4, 0, 0, 4, 2, 0, 2, 2, 0, 6, 0, 1, 4, 0, 4, 2, 0, 0, 2
Offset: 0

Views

Author

Vladimir Shevelev, Jun 02 2009

Keywords

Comments

a(n)=0 iff n is in A067076, i.e., 2n+3 is prime; a(n) is the number of positive integers of the form (n-3k)/(2k+1), 1<=k<=n/3.

Examples

			Since for n=3 we have 2n+3=9 and only nontrivial divisor of 9 is 3, then a(3)=1.
		

Crossrefs

Programs

Formula

For n>=1, a(n)=A160973(n)+A079978(n). [Vladimir Shevelev, Jun 07 2009]
a(n) = A070824(2n+3).

Extensions

Edited by Charles R Greathouse IV, Oct 12 2009
More terms from Michel Marcus, Feb 08 2016

A338785 a(n) is the least number k such that continued fraction for sqrt(prime(k)) has period n.

Original entry on oeis.org

1, 2, 13, 4, 6, 8, 21, 11, 30, 14, 18, 27, 44, 41, 29, 43, 37, 34, 68, 36, 42, 94, 147, 58, 88, 47, 186, 93, 142, 75, 110, 90, 112, 67, 178, 228, 82, 114, 100, 222, 187, 105, 191, 143, 204, 131, 180, 115, 172, 177, 197, 133, 263, 272, 353, 175, 231, 242, 322, 157
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 08 2020

Keywords

Examples

			sqrt(prime(1))  = sqrt(2)  = 1 + 1/(2 + 1/(2 + ...)), period 1.
sqrt(prime(2))  = sqrt(3)  = 1 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + ...)))), period 2.
sqrt(prime(13)) = sqrt(41) = 6 + 1/(2 + 1/(2 + 1/(12 + 1/(2 + 1/(2 + 1/(12 + ...)))))), period 3.
		

Crossrefs

Programs

  • Maple
    N:= 100: # for a(1)..a(N)
    A:= Vector(N): count:= 0: p:= 1:
    for n from 1 while count < N do
      p:= nextprime(p);
      v:= nops(numtheory:-cfrac(sqrt(p),periodic,quotients)[2]);
      if v <= N and A[v] = 0 then count:= count+1; A[v]:= n; fi
    od:
    convert(A,list); # Robert Israel, Nov 11 2020
  • Mathematica
    Table[SelectFirst[Range[500], Length[Last[ContinuedFraction[Sqrt[Prime[#]]]]] == n &], {n, 60}]

Formula

a(n) = A000720(A059800(n)).

A338779 a(n) is the smallest number k such that period of continued fraction for sqrt(prime(j)) equal for all prime(k) <= prime(j) < prime(k + n).

Original entry on oeis.org

1, 97, 141043
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 08 2020

Keywords

Comments

The corresponding primes are 2, 509, 1885717, ...

Examples

			sqrt(prime(97)) = sqrt(509) has continued fraction [22; 1, 1, 3, 1, 1, 2, 10, 1, 8, 8, 1, 10, 2, 1, 1, 3, 1, 1, 44, ...], period 19.
sqrt(prime(98)) = sqrt(521) has continued fraction [22; 1, 4, 1, 2, 1, 2, 8, 1, 3, 3, 1, 8, 2, 1, 2, 1, 4, 1, 44, ...], period 19.
These are the first 2 consecutive primes with the same period of continued fraction for square root, so a(2) = 97.
		

Crossrefs

Programs

  • Mathematica
    A054269[n_] := Module[{s = Sqrt[Prime[n]]}, If[IntegerQ[s], 0, Length[ContinuedFraction[s][[2]]]]]; Do[find = 0; k = 0; While[find == 0, k++; If[Length[Union[Table[A054269[j], {j, k, k + n - 1}]]] == 1, find = 1; Print[k]]], {n, 1, 3}]
Previous Showing 11-17 of 17 results.