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.

A251731 Least k such that k^3 + q is divisible by 3^n where q is the n-th number congruent to 1 or -1 (mod 18).

Original entry on oeis.org

2, 1, 2, 16, 32, 145, 62, 1363, 3458, 19492, 58928, 89308, 70028, 1594318, 1890551, 189871, 31401806, 47918575, 190704887, 163454602, 502048577, 9481323661, 11627845304, 34656488290, 115450061084, 286130228125, 2303721331049, 1569269836240, 22013516320412
Offset: 1

Views

Author

Michel Lagneau, Dec 07 2014

Keywords

Comments

It is known that k always exists if q is congruent to +-1 mod 18.
The numbers congruent to 1 or -1 (mod 18) are 1, 17, 19, 35, 37, ... = {A161705} UNION {A239129}.
For n >= 2, k^3 == (9 - 18*n - 7*(-1)^n)/2 (mod 3^n) if and only if k - a(n) is divisible by 3^(n-1). - Jinyuan Wang, Feb 13 2020

Examples

			a(1) = 2 because the first number of the form +-1 (mod 18) is 1, and 2^3 + 1 = 9 = 3*3^1;
a(2) = 1 because the second number of the form +-1 (mod 18) is 17, and 1^3 + 17 = 18 = 2*3^2;
a(3) = 2 because the third number of the form +-1 (mod 18) is 19, and 2^3 + 19 = 27 = 3^3;
a(4)= 16 because the fourth number of the form +-1 (mod 18) is 35, and 16^3 + 35 = 4131 = 51*3^4.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local q,R,k;
      if n::odd then q:= 9*n-8 else q:= 9*n-1 fi;
      min(map(subs,[msolve(k^3+q,3^n)],k))
    end proc:
    map(f, [$1..30]); # Robert Israel, Dec 23 2018
  • Mathematica
    lst1={1};Do[lst1=Union[lst1,Union[{18*n+1},{18*n-1}]],{n,1,10}];lst={};Do[k=1;While[Mod[k^3+lst1[[n]],3^n]!=0,k++];Print[n," ",k],{n,1,10}];lst
  • PARI
    a(n) = {if (n % 2, q = 9*(n-1)+1, q = 9*n-1); m = 3^n; k = 1; while ((k^3+q) % m, k++); k;} \\ Michel Marcus, Jan 07 2015