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-10 of 12 results. Next

A002144 Pythagorean primes: primes of the form 4*k + 1.

Original entry on oeis.org

5, 13, 17, 29, 37, 41, 53, 61, 73, 89, 97, 101, 109, 113, 137, 149, 157, 173, 181, 193, 197, 229, 233, 241, 257, 269, 277, 281, 293, 313, 317, 337, 349, 353, 373, 389, 397, 401, 409, 421, 433, 449, 457, 461, 509, 521, 541, 557, 569, 577, 593, 601, 613, 617
Offset: 1

Views

Author

Keywords

Comments

Rational primes that decompose in the field Q(sqrt(-1)). - N. J. A. Sloane, Dec 25 2017
These are the prime terms of A009003.
-1 is a quadratic residue mod a prime p if and only if p is in this sequence.
Sin(a(n)*Pi/2) = 1 with Pi = 3.1415..., see A070750. - Reinhard Zumkeller, May 04 2002
If at least one of the odd primes p, q belongs to the sequence, then either both or neither of the congruences x^2 = p (mod q), x^2 = q (mod p) are solvable, according to Gauss reciprocity law. - Lekraj Beedassy, Jul 17 2003
Odd primes such that binomial(p-1, (p-1)/2) == 1 (mod p). - Benoit Cloitre, Feb 07 2004
Primes that are the hypotenuse of a right triangle with integer sides. The Pythagorean triple is {A002365(n), A002366(n), a(n)}.
Also, primes of the form a^k + b^k, k > 1. - Amarnath Murthy, Nov 17 2003
The square of a(n) is the average of two other squares. This fact gives rise to a class of monic polynomials x^2 + bx + c with b = a(n) that will factor over the integers regardless of the sign of c. See A114200. - Owen Mertens (owenmertens(AT)missouristate.edu), Nov 16 2005
Also such primes p that the last digit is always 1 for the Nexus numbers of form n^p - (n-1)^p. - Alexander Adamchuk, Aug 10 2006
The set of Pythagorean primes is a proper subset of the set of positive fundamental discriminants (A003658). - Paul Muljadi, Mar 28 2008
A079260(a(n)) = 1; complement of A137409. - Reinhard Zumkeller, Oct 11 2008
From Artur Jasinski, Dec 10 2008: (Start)
If we take 4 numbers: 1, A002314(n), A152676(n), A152680(n) then multiplication table modulo a(n) is isomorphic to the Latin square:
1 2 3 4
2 4 1 3
3 1 4 2
4 3 2 1
and isomorphic to the multiplication table of {1, i, -i, -1} where i is sqrt(-1), A152680(n) is isomorphic to -1, A002314(n) with i or -i and A152676(n) vice versa -i or i. 1, A002314(n), A152676(n), A152680(n) are subfield of Galois field [a(n)]. (End)
Primes p such that the arithmetic mean of divisors of p^3 is an integer. There are 2 sequences of such primes: this one and A002145. - Ctibor O. Zizka, Oct 20 2009
Equivalently, the primes p for which the smallest extension of F_p containing the square roots of unity (necessarily F_p) contains the 4th roots of unity. In this respect, the n = 2 case of a family of sequences: see n=3 (A129805) and n=5 (A172469). - Katherine E. Stange, Feb 03 2010
Subsequence of A007969. - Reinhard Zumkeller, Jun 18 2011
A151763(a(n)) = 1.
k^k - 1 is divisible by 4*k + 1 if 4*k + 1 is a prime (see Dickson reference). - Gary Detlefs, May 22 2013
Not only are the squares of these primes the sum of two nonzero squares, but the primes themselves are also. 2 is the only prime equal to the sum of two nonzero squares and whose square is not. 2 is therefore not a Pythagorean prime. - Jean-Christophe Hervé, Nov 10 2013
The statement that these primes are the sum of two nonzero squares follows from Fermat's theorem on the sum of two squares. - Jerzy R Borysowicz, Jan 02 2019
The decompositions of the prime and its square into two nonzero squares are unique. - Jean-Christophe Hervé, Nov 11 2013. See the Dickson reference, Vol. II, (B) on p. 227. - Wolfdieter Lang, Jan 13 2015
p^e for p prime of the form 4*k+1 and e >= 1 is the sum of 2 nonzero squares. - Jon Perry, Nov 23 2014
Primes p such that the area of the isosceles triangle of sides (p, p, q) for some integer q is an integer. - Michel Lagneau, Dec 31 2014
This is the set of all primes that are the average of two squares. - Richard R. Forberg, Mar 01 2015
Numbers k such that ((k-3)!!)^2 == -1 (mod k). - Thomas Ordowski, Jul 28 2016
This is a subsequence of primes of A004431 and also of A016813. - Bernard Schott, Apr 30 2022
In addition to the comment from Jean-Christophe Hervé, Nov 10 2013: All powers as well as the products of any of these primes are the sum of two nonzero squares. They are terms of A001481, which is closed under multiplication. - Klaus Purath, Nov 19 2023

Examples

			The following table shows the relationship between several closely related sequences:
Here p = A002144 = primes == 1 (mod 4), p = a^2+b^2 with a < b;
a = A002331, b = A002330, t_1 = ab/2 = A070151;
p^2 = c^2 + d^2 with c < d; c = A002366, d = A002365,
t_2 = 2ab = A145046, t_3 = b^2 - a^2 = A070079,
with {c,d} = {t_2, t_3}, t_4 = cd/2 = ab(b^2-a^2).
  ---------------------------------
   p  a  b  t_1  c   d t_2 t_3  t_4
  ---------------------------------
   5  1  2   1   3   4   4   3    6
  13  2  3   3   5  12  12   5   30
  17  1  4   2   8  15   8  15   60
  29  2  5   5  20  21  20  21  210
  37  1  6   3  12  35  12  35  210
  41  4  5  10   9  40  40   9  180
  53  2  7   7  28  45  28  45  630
  ...
a(7) = 53 = A002972(7)^2 + (2*A002973(7))^2 = 7^2 + (2*1)^2 = 49 + 4, and this is the only way. - _Wolfdieter Lang_, Jan 13 2015
		

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.
  • L. E. Dickson, "History of the Theory of Numbers", Chelsea Publishing Company, 1919, Vol I, page 386
  • L. E. Dickson, History of the Theory of Numbers, Carnegie Institution, Publ. No. 256, Vol. II, Washington D.C., 1920, p. 227.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 132.
  • M. du Sautoy, The Music of the Primes, Fourth Estate / HarperCollins, 2003; see p. 76.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 241, 243.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 90.

Crossrefs

Cf. A004613 (multiplicative closure).
Apart from initial term, same as A002313.
For values of n see A005098.
Primes in A020668.

Programs

  • Haskell
    a002144 n = a002144_list !! (n-1)
    a002144_list = filter ((== 1) . a010051) [1,5..]
    -- Reinhard Zumkeller, Mar 06 2012, Feb 22 2011
    
  • Magma
    [a: n in [0..200] | IsPrime(a) where a is 4*n + 1 ]; // Vincenzo Librandi, Nov 23 2014
    
  • Maple
    a := []; for n from 1 to 500 do if isprime(4*n+1) then a := [op(a),4*n+1]; fi; od: A002144 := n->a[n];
    # alternative
    A002144 := proc(n)
        option remember ;
        local a;
        if n = 1 then
            5;
        else
            for a from procname(n-1)+4 by 4 do
                if isprime(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A002144(n),n=1..100) ; # R. J. Mathar, Jan 31 2024
  • Mathematica
    Select[4*Range[140] + 1, PrimeQ[ # ] &] (* Stefan Steinerberger, Apr 16 2006 *)
    Select[Prime[Range[150]],Mod[#,4]==1&] (* Harvey P. Dale, Jan 28 2021 *)
  • PARI
    select(p->p%4==1,primes(1000))
    
  • PARI
    A002144_next(p=A2144[#A2144])={until(isprime(p+=4),);p} /* NB: p must be of the form 4k+1. Beyond primelimit, this is *much* faster than forprime(p=...,, p%4==1 && return(p)). */
    A2144=List(5); A002144(n)={while(#A2144A002144_next())); A2144[n]}
    \\ M. F. Hasler, Jul 06 2024
    
  • Python
    from sympy import prime
    A002144 = [n for n in (prime(x) for x in range(1,10**3)) if not (n-1) % 4]
    # Chai Wah Wu, Sep 01 2014
    
  • Python
    from sympy import isprime
    print(list(filter(isprime, range(1, 618, 4)))) # Michael S. Branicky, May 13 2021
    
  • SageMath
    def A002144_list(n): # returns all Pythagorean primes <= n
        return [x for x in prime_range(5,n+1) if x % 4 == 1]
    A002144_list(617) # Peter Luschny, Sep 12 2012

Formula

Odd primes of form x^2 + y^2, (x=A002331, y=A002330, with x < y) or of form u^2 + 4*v^2, (u = A002972, v = A002973, with u odd). - Lekraj Beedassy, Jul 16 2004
p^2 - 1 = 12*Sum_{i = 0..floor(p/4)} floor(sqrt(i*p)) where p = a(n) = 4*n + 1. [Shirali]
a(n) = A000290(A002972(n)) + A000290(2*A002973(n)) = A000290(A002331(n+1)) + A000290(A002330(n+1)). - Reinhard Zumkeller, Feb 16 2010
a(n) = A002972(n)^2 + (2*A002973(n))^2, n >= 1. See the Jean-Christophe Hervé Nov 11 2013 comment. - Wolfdieter Lang, Jan 13 2015
a(n) = 4*A005098(n) + 1. - Zak Seidov, Sep 16 2018
From Vaclav Kotesovec, Apr 30 2020: (Start)
Product_{k>=1} (1 - 1/a(k)^2) = A088539.
Product_{k>=1} (1 + 1/a(k)^2) = A243380.
Product_{k>=1} (1 - 1/a(k)^3) = A334425.
Product_{k>=1} (1 + 1/a(k)^3) = A334424.
Product_{k>=1} (1 - 1/a(k)^4) = A334446.
Product_{k>=1} (1 + 1/a(k)^4) = A334445.
Product_{k>=1} (1 - 1/a(k)^5) = A334450.
Product_{k>=1} (1 + 1/a(k)^5) = A334449. (End)
From Vaclav Kotesovec, May 05 2020: (Start)
Product_{k>=1} (1 + 1/A002145(k)) / (1 + 1/a(k)) = Pi/(4*A064533^2) = 1.3447728438248695625516649942427635670667319092323632111110962...
Product_{k>=1} (1 - 1/A002145(k)) / (1 - 1/a(k)) = Pi/(8*A064533^2) = 0.6723864219124347812758324971213817835333659546161816055555481... (End)
Sum_{k >= 1} 1/a(k)^s = (1/2) * Sum_{n >= 1 odd numbers} moebius(n) * log((2*n*s)! * zeta(n*s) * abs(EulerE(n*s - 1)) / (Pi^(n*s) * 2^(2*n*s) * BernoulliB(2*n*s) * (2^(n*s) + 1) * (n*s - 1)!))/n, s >= 3 odd number. - Dimitris Valianatos, May 21 2020
Legendre symbol (-1, a(n)) = +1, for n >= 1. - Wolfdieter Lang, Mar 03 2021

A056020 Numbers that are congruent to +-1 mod 9.

Original entry on oeis.org

1, 8, 10, 17, 19, 26, 28, 35, 37, 44, 46, 53, 55, 62, 64, 71, 73, 80, 82, 89, 91, 98, 100, 107, 109, 116, 118, 125, 127, 134, 136, 143, 145, 152, 154, 161, 163, 170, 172, 179, 181, 188, 190, 197, 199, 206, 208, 215, 217, 224, 226, 233, 235, 242, 244, 251, 253
Offset: 1

Views

Author

Robert G. Wilson v, Jun 08 2000

Keywords

Comments

Or, numbers k such that k^2 == 1 (mod 9).
Or, numbers k such that the iterative cycle j -> sum of digits of j^2 when started at k contains a 1. E.g., 8 -> 6+4 = 10 -> 1+0+0 = 1 and 17 -> 2+8+9 = 19 -> 3+6+1 = 10 -> 1+0+0 = 1. - Asher Auel, May 17 2001

Crossrefs

Cf. A007953, A047522 (n=1 or 7 mod 8), A090771 (n=1 or 9 mod 10).
Cf. A129805 (primes), A195042 (partial sums).
Cf. A381319 (general case mod n^2).

Programs

  • Haskell
    a056020 n = a056020_list !! (n-1)
    a05602_list = 1 : 8 : map (+ 9) a056020_list
    -- Reinhard Zumkeller, Jan 07 2012
  • Mathematica
    Select[ Range[ 300 ], PowerMod[ #, 2, 3^2 ]==1& ]
    (* or *)
    LinearRecurrence[{1, 1, -1}, {1, 8, 10}, 67] (* Mike Sheppard, Feb 18 2025 *)
  • PARI
    a(n)=9*(n>>1)+if(n%2,1,-1) \\ Charles R Greathouse IV, Jun 29 2011
    
  • PARI
    for(n=1,40,print1(9*n-8,", ",9*n-1,", ")) \\ Charles R Greathouse IV, Jun 29 2011
    

Formula

a(1) = 1; a(n) = 9(n-1) - a(n-1). - Rolf Pleisch, Jan 31 2008 [Offset corrected by Jon E. Schoenfield, Dec 22 2008]
From R. J. Mathar, Feb 10 2008: (Start)
O.g.f.: 1 + 5/(4(x+1)) + 27/(4(-1+x)) + 9/(2(-1+x)^2).
a(n+1) - a(n) = A010697(n). (End)
a(n) = (9*A132355(n) + 1)^(1/2). - Gary Detlefs, Feb 22 2010
From Bruno Berselli, Nov 17 2010: (Start)
a(n) = a(n-2) + 9, for n > 2.
a(n) = 9*A000217(n-1) + 1 - 2*Sum_{i=1..n-1} a(i), n > 1. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (Pi/9)*cot(Pi/9) = A019676 * A019968. - Amiram Eldar, Dec 04 2021
E.g.f.: 1 + ((18*x - 9)*exp(x) + 5*exp(-x))/4. - David Lovler, Sep 04 2022
From Amiram Eldar, Nov 22 2024: (Start)
Product_{n>=1} (1 - (-1)^n/a(n)) = 2*cos(Pi/9) (A332437).
Product_{n>=2} (1 + (-1)^n/a(n)) = (Pi/9)*cosec(Pi/9). (End)
From Mike Sheppard, Feb 18 2025: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3).
a(n) ~ (3^2/2)*n. (End)

A132230 Primes congruent to 1 (mod 30).

Original entry on oeis.org

31, 61, 151, 181, 211, 241, 271, 331, 421, 541, 571, 601, 631, 661, 691, 751, 811, 991, 1021, 1051, 1171, 1201, 1231, 1291, 1321, 1381, 1471, 1531, 1621, 1741, 1801, 1831, 1861, 1951, 2011, 2131, 2161, 2221, 2251, 2281, 2311, 2341, 2371, 2521, 2551, 2671
Offset: 1

Views

Author

Omar E. Pol, Aug 15 2007

Keywords

Comments

Also primes congruent to 1 (mod 15). - N. J. A. Sloane, Jul 11 2008
Primes ending in 1 with (SOD-1)/3 integer where SOD is sum of digits. - Ki Punches, Feb 04 2009

Examples

			From _Muniru A Asiru_, Nov 01 2017: (Start)
31 is a prime and 31 = 30*1 + 1;
61 is a prime and 61 = 30*2 + 1;
151 is a prime and 151 = 30*5 + 1;
211 is a prime and 211 = 30*7 + 1;
241 is a prime and 241 = 30*8 + 1;
271 is a prime and 271 = 30*9 + 1.
(End)
		

Crossrefs

Programs

Formula

a(n) = A111175(n)*30 + 1. - Ray Chandler, Apr 07 2009
Intersection of A030430 and A002476. - Ray Chandler, Apr 07 2009

Extensions

Edited by Ray Chandler, Apr 07 2009

A129807 Primes congruent to +-7 mod 18.

Original entry on oeis.org

7, 11, 29, 43, 47, 61, 79, 83, 97, 101, 137, 151, 173, 191, 223, 227, 241, 263, 277, 281, 313, 317, 331, 349, 353, 367, 389, 421, 439, 443, 457, 461, 479, 547, 569, 587, 601, 619, 641, 659, 673, 677, 691, 709, 727, 821, 839, 853, 857, 907, 911, 929, 947, 983, 997, 1019
Offset: 1

Views

Author

N. J. A. Sloane, May 22 2007

Keywords

Comments

Also: primes that are sums of three consecutive terms of A001651. These sum to either 3k+1+3k+2+3k+4=9k+7, candidates for A061241, or 3k+2+3k+4+3k+5=9k+11, candidates for A061238. - R. J. Mathar, Jun 10 2007

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(1300) | p mod 18 in {7, 11} ]; // Vincenzo Librandi, Aug 14 2012
  • Mathematica
    Select[Prime[Range[1000]],MemberQ[{7,11},Mod[ #,18]]&] (* Zak Seidov, May 23 2007 *)

Formula

Conjecture: Equals (A061241 UNION A061238) MINUS {2}. - R. J. Mathar, Jun 10 2007

A132243 Twin primes congruent to {1, 29} mod 30.

Original entry on oeis.org

29, 31, 59, 61, 149, 151, 179, 181, 239, 241, 269, 271, 419, 421, 569, 571, 599, 601, 659, 661, 809, 811, 1019, 1021, 1049, 1051, 1229, 1231, 1289, 1291, 1319, 1321, 1619, 1621, 1949, 1951, 2129, 2131, 2309, 2311, 2339, 2341, 2549, 2551, 2729, 2731, 2789
Offset: 1

Views

Author

Omar E. Pol, Aug 15 2007

Keywords

Comments

Twin primes of the form 5*n +- 1. - Bruno Berselli, Aug 26 2014

Crossrefs

Programs

  • Mathematica
    a[0] = 9; a[n_] := a[n] = a[n - 1] + 10; Flatten[Table[If[PrimeQ[a[n]] && PrimeQ[a[n] + 2], {a[n],a[n] + 2}, {}], {n, 0, 300}]] (* Roger L. Bagula, May 04 2008 *)
    Flatten[Select[#+{-1,1}&/@(5*Range[0,600,2]),AllTrue[#,PrimeQ]&]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Feb 21 2020 *)

Extensions

More terms from Roger L. Bagula, May 04 2008

A129806 Primes congruent to +-5 mod 18.

Original entry on oeis.org

5, 13, 23, 31, 41, 59, 67, 103, 113, 131, 139, 149, 157, 167, 193, 211, 229, 239, 257, 283, 293, 311, 337, 347, 373, 383, 401, 409, 419, 463, 491, 499, 509, 563, 571, 599, 607, 617, 643, 653, 661, 733, 743, 751, 761, 769, 787, 797, 823, 859, 877, 887, 941, 967, 977, 1013
Offset: 1

Views

Author

N. J. A. Sloane, May 22 2007

Keywords

Comments

Primes congruent to (5,13) mod 18. - Vincenzo Librandi, Aug 14 2012

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(1300) | p mod 18 in {5, 13} ]; // Vincenzo Librandi, Aug 14 2012
  • Mathematica
    Select[Prime[Range[4000]],MemberQ[{5,13},Mod[#,18]]&] (* Vincenzo Librandi, Aug 14 2012 *)

A132240 Primes congruent to {1, 29} mod 30.

Original entry on oeis.org

29, 31, 59, 61, 89, 149, 151, 179, 181, 211, 239, 241, 269, 271, 331, 359, 389, 419, 421, 449, 479, 509, 541, 569, 571, 599, 601, 631, 659, 661, 691, 719, 751, 809, 811, 839, 929, 991, 1019, 1021, 1049, 1051, 1109, 1171, 1201, 1229, 1231
Offset: 1

Views

Author

Omar E. Pol, Aug 15 2007

Keywords

Comments

For every prime p here, the cyclotomic polynomial Phi(15p,x) is flat.
Primes in A175887. [Reinhard Zumkeller, Jan 07 2012]

Crossrefs

Programs

  • Haskell
    a132240 n = a132240_list !! (n-1)
    a132240_list = [x | x <- a175887_list, a010051 x == 1]
    -- Reinhard Zumkeller, Jan 07 2012
    
  • Magma
    [ p: p in PrimesUpTo(1300) | p mod 30 in {1, 29} ]; // Vincenzo Librandi, Aug 14 2012
  • Mathematica
    Select[Prime[Range[1000]],MemberQ[{1,29},Mod[#,30]]&] (* Vincenzo Librandi, Aug 14 2012 *)
    Select[Flatten[#+{1,29}&/@(30Range[0,50])],PrimeQ] (* Harvey P. Dale, Sep 08 2021 *)

A172469 Primes congruent to +/-1 or +/-7 modulo 25.

Original entry on oeis.org

7, 43, 101, 107, 149, 151, 157, 193, 199, 251, 257, 293, 307, 349, 401, 443, 449, 457, 499, 557, 593, 599, 601, 607, 643, 701, 743, 751, 757, 857, 907, 1049, 1051, 1093, 1151, 1193, 1201, 1249, 1301, 1307, 1399, 1451, 1493, 1499, 1543, 1549, 1601, 1607
Offset: 1

Views

Author

Katherine E. Stange, Feb 03 2010

Keywords

Comments

Equivalently, primes p such that the smallest extension of F_p containing the 5th roots of unity also contains the 25th roots of unity.
In this respect, the sequence is the n=5 instance of a family of sequences. For n=3, see A129805, and for n=2, see A002144.
Equivalently, the primes p for which, if p^t = 1 mod 5, then p^t = 1 mod 25.

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime
    def A172469_gen(): # generator of terms
        yield from (7, 43)
        for n in count(50,50):
            for m in (1,7,43,49):
                if isprime(n+m):
                    yield n+m
    A172469_list = list(islice(A172469_gen(),48)) # Chai Wah Wu, Apr 28 2025

Formula

A141927 U A141932 U A141946 U A141941. [From R. J. Mathar, Feb 05 2010]

Extensions

More terms from R. J. Mathar, Feb 05 2010

A132246 Twin primes congruent to {1, 17, 19, 29} mod 30.

Original entry on oeis.org

17, 19, 29, 31, 59, 61, 107, 109, 137, 139, 149, 151, 179, 181, 197, 199, 227, 229, 239, 241, 269, 271, 347, 349, 419, 421, 569, 571, 599, 601, 617, 619, 659, 661, 809, 811, 827, 829, 857, 859, 1019, 1021, 1049, 1051, 1229, 1231
Offset: 1

Views

Author

Omar E. Pol, Aug 17 2007

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Union[Flatten[Select[Partition[Prime[Range[300]],2,1],#[[2]]- #[[1]] == 2&]]],MemberQ[{1,17,19,29},Mod[#,30]]&] (* Harvey P. Dale, Feb 09 2015 *)

A212328 Smallest k such that k^3 + 17 is divisible by 3^n.

Original entry on oeis.org

1, 1, 4, 4, 58, 139, 139, 1597, 1597, 8158, 8158, 67207, 67207, 598648, 2192971, 6975940, 21324847, 21324847, 21324847, 408745336, 1571006803, 8544575605, 29465282011, 29465282011, 217751639665, 500181176146, 1347469785589, 6431201442247, 6431201442247
Offset: 1

Views

Author

Michel Lagneau, May 14 2012

Keywords

Comments

This sequence is generalizable : the smallest k such that k^3 + p is divisible by 3^n exists if the prime p is congruent to + - 1 mod 18. For example, the sequence with p = 19 is given by {2, 2, 2, 20, 20, 20, 263, 992, 3179, 16301, 55667, 173765, 528059, …}. (See A129805). This sequence is given with the smallest p = 17.

Examples

			a(4) = 4 because 4^3 + 17 = 81 is divisible by 3^4.
		

Crossrefs

Cf. A129805.

Programs

  • Maple
    with(numtheory):for n from 1 to 20 do:i:=0:for x from 1 to 10^8 while(i=0) do: z:= x^3 + 17:if irem(z,3^n)=0 then i:=1: printf ( "%d %d \n",n,x):else fi:od:od:
  • PARI
    print1(k=1);for(n=2,100,if(Mod(k,3^n)^3!=-17,k+=3^(n-2)* if(Mod(k+3^(n-2),3^n)^3==-17,1,2));print1(", "k)) \\ Charles R Greathouse IV, May 14 2012

Extensions

a(20)-a(29) from Charles R Greathouse IV, May 14 2012
Showing 1-10 of 12 results. Next