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.

Showing 1-2 of 2 results.

A059772 Smallest prime p such that n is a solution mod p of x^2 = 2, or 0 if no such prime exists.

Original entry on oeis.org

0, 7, 7, 23, 17, 47, 31, 79, 0, 17, 71, 167, 97, 223, 127, 41, 23, 359, 199, 439, 241, 31, 41, 89, 337, 727, 0, 839, 449, 137, 73, 1087, 577, 1223, 647, 1367, 103, 0, 47, 73, 881, 1847, 967, 0, 151, 2207, 1151, 2399, 1249, 113, 193, 401, 0, 3023, 1567, 191, 0, 71
Offset: 2

Views

Author

Klaus Brockhaus, Feb 21 2001

Keywords

Comments

Solutions mod p are represented by integers from 0 to p-1. The following equivalences hold for n > 1: There is a prime p such that n is a solution mod p of x^2 = 2 iff n^2-2 has a prime factor > n; n is a solution mod p of x^2 = 2 iff p is a prime factor of n^2-2 and p > n. n^2-2 has at most one prime factor > n, consequently such a factor is the only prime p such that n is a solution mod p of x^2 = 2. For n such that n^2-2 has no prime factor > n (the zeros in the sequence), cf. A060515.

Examples

			a(11) = 17, since 11 is a solution mod 17 of x^2 = 2 and 11 is not a solution mod p of x^2 = 2 for primes p < 17. Although 11^2 = 2 mod 7, prime 7 is excluded because 7 < 11 and 11 = 4 mod 7.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local P;
      P:= select(`>`,numtheory:-factorset(n^2-2),n);
      if P = {} then 0 else min(P) fi
    end proc:
    map(f, [$2..100]); # Robert Israel, Feb 23 2016
  • Mathematica
    a[n_] := Module[{P}, P = Select[FactorInteger[n^2 - 2][[All, 1]], # > n&]; If[P == {}, 0, Min[P]]];
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Apr 10 2019, from Maple *)

Formula

If n^2-2 has a (unique) prime factor p > n, then a(n) = p, else a(n) = 0.

Extensions

Offset corrected by R. J. Mathar, Aug 21 2009

A363102 Denominator of the continued fraction 1/(2-3/(3-4/(4-5/(...(n-1)-n/(-2))))).

Original entry on oeis.org

7, 7, 23, 17, 47, 31, 79, 7, 17, 71, 167, 97, 223, 127, 41, 23, 359, 199, 439, 241, 31, 41, 89, 337, 727, 1, 839, 449, 137, 73, 1087, 577, 1223, 647, 1367, 103, 1, 47, 73, 881, 1847, 967, 1, 151, 2207, 1151, 2399, 1249, 113, 193, 401, 1, 3023, 1567, 191, 41, 71, 257, 3719, 113, 3967, 89, 103, 311
Offset: 3

Views

Author

Mohammed Bouras, May 19 2023

Keywords

Comments

Conjecture 1: The sequence contains only 1's and primes.
Conjecture 2: All prime numbers appear either twice (same as A356247 and A357127) or three times.
Similar terms of A164314.
Conjecture: Record values correspond to A028871(m), m > 1. - Bill McEachen, Mar 06 2024
a(n) = 1 positions appear to correspond to A060515(m), m > 2. - Bill McEachen, Aug 05 2024

Examples

			a(5) = (5^2 - 2)/gcd(5^2 - 2, 2*A051403(5-3) + 5*A051403(5-4))= 23.
a(6) = a(11) = 6 + 11 = 17.
a(7) = a(40) = 7 + 40 = 47.
		

Crossrefs

Programs

  • PARI
    a051403(n) = (n+2)*sum(k=0, n, k!)/2;
    a(n) = (n^2 - 2)/gcd(n^2 - 2, 2*a051403(n-3) + n*a051403(n-4)); \\ Michel Marcus, May 24 2023

Formula

a(n) = (n^2 - 2)/gcd(n^2 - 2, 2*A051403(n-3) + n*A051403(n-4)).
a(n) = A164314(n) if A164314(n) > n.
If a(n) = a(m) and n < m < a(n), then a(n) = n + m.
Showing 1-2 of 2 results.