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.

User: Dmitry Kamenetsky

Dmitry Kamenetsky's wiki page.

Dmitry Kamenetsky has authored 155 sequences. Here are the ten most recent ones:

A366928 a(n) is the smallest nonnegative k such that A301573(k) = n.

Original entry on oeis.org

1, 0, 6, 12, 20, 41, 42, 56, 72, 90, 110, 155, 156, 182, 270, 271, 272, 306, 379, 380, 420, 462, 551, 552, 600, 650, 702, 756, 812, 870, 930, 1055, 1056, 1122, 1190, 1260, 1405, 1406, 1482, 1560, 1640, 1805, 1806, 1892, 1980, 2254, 2255, 2256, 2352, 2450, 2550, 2652, 2861, 2862, 2970
Offset: 0

Author

Dmitry Kamenetsky, Oct 28 2023

Keywords

Comments

If negative values were allowed then one could argue a(n) = 1-n from the name of A301573. - David A. Corneth, Nov 13 2023

Examples

			a(3) = 12 as 12 is the smallest positive integer that is 3 away from the closest perfect power (namely 9 = 3^2). - _David A. Corneth_, Nov 12 2023
		

Crossrefs

Programs

  • PARI
    ispp(n) = {ispower(n) || n==1}; \\ A001597
    f(n) = my(k=0); while(!ispp(n+k) && !ispp(n-k), k++); k; \\ A301573
    a(n) = my(k=0); while (f(k) != n, k++); k; \\ Michel Marcus, Oct 29 2023
    
  • PARI
    \\ See PARI link
    
  • Python
    from itertools import count
    from sympy import perfect_power
    def A366928(n): return next(m for m in count(0) if next(k for k in count(0) if perfect_power(m+k) or perfect_power(m-k) or m-k==1 or m+k==1) == n) # Chai Wah Wu, Nov 12 2023

Formula

a(n) > n^2 for n > 1. - David A. Corneth, Nov 13 2023

Extensions

More terms from Michel Marcus, Oct 29 2023

A364692 Largest number that is the sum of n distinct primes in exactly n ways; 0 if no solution exists.

Original entry on oeis.org

68, 130, 42, 59, 76, 0, 0, 161, 192, 233, 227, 276, 0, 425, 480, 0, 0, 0, 752
Offset: 2

Author

Dmitry Kamenetsky, Aug 03 2023

Keywords

Examples

			68 = 7 + 61 = 31 + 37 and there is no larger number that is the sum of 2 distinct primes in exactly 2 ways, so a(2)=68.
130 = 2 + 19 + 109 = 2 + 31 + 97 = 2 + 61 + 67 and there is no larger number that is the sum of 3 distinct primes in exactly 3 ways, so a(3)=130.
		

Crossrefs

Cf. A344989 asks for the smallest number with the same properties.

A363274 a(n) is the smallest prime such that a(1)*a(2)*...*a(n) +/- 1 is prime.

Original entry on oeis.org

2, 2, 2, 2, 2, 3, 2, 2, 2, 11, 3, 3, 2, 2, 5, 2, 2, 3, 3, 5, 2, 2, 5, 2, 2, 7, 3, 3, 2, 2, 23, 47, 2, 2, 2, 29, 2, 53, 13, 5, 17, 29, 5, 3, 3, 3, 5, 17, 2, 3, 3, 79, 31, 11, 7, 23, 2, 7, 3, 7, 2, 13, 5, 7, 5, 7, 23, 17, 23, 13, 31, 29, 7, 67, 47, 7, 2, 23, 13, 23, 23, 31, 73, 13, 23, 3, 17
Offset: 1

Author

Dmitry Kamenetsky, Jul 08 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[n_] := a[n] = Module[{r = Product[a[k], {k, 1, n - 1}], p = 2}, While[! PrimeQ[r*p - 1] && ! PrimeQ[r*p + 1], p = NextPrime[p]]; p]; Array[a, 100] (* Amiram Eldar, Jul 08 2023 *)

A360803 Numbers whose squares have a digit average of 8 or more.

Original entry on oeis.org

3, 313, 94863, 298327, 987917, 3162083, 9893887, 29983327, 99477133, 99483667, 197483417, 282753937, 314623583, 315432874, 706399164, 773303937, 894303633, 947047833, 948675387, 989938887, 994927133, 994987437, 998398167, 2428989417, 2754991833, 2983284917, 2999833327
Offset: 1

Author

Dmitry Kamenetsky, Feb 21 2023

Keywords

Comments

This sequence is infinite. For example, numbers floor(30*100^k - (5/3)*10^k) beginning with 2 followed by k 9s, followed by 8 and k 3s, have a square whose digit average converges to (but never equals) 8.25. [Corrected and formula added by M. F. Hasler, Apr 11 2023]
Only a few examples are known whose square has a digit average of 8.25 and above: 3^2 = 9, 707106074079263583^2 = 499998999999788997978888999589997889 (digit average 8.25), 94180040294109027313^2 = 8869879989799999999898984986998979999969 (digit average 8.275).
This is the union of A164772 (digit average = 8) and A164841 (digit average > 8). - M. F. Hasler, Apr 11 2023

Examples

			94863 is in the sequence, because 94863^2 = 8998988769, which has a digit average of 8.1 >= 8.
		

Crossrefs

Cf. A164772 (digit average = 8), A164841 (digit average > 8).

Programs

  • PARI
    isok(k) = my(d=digits(k^2)); vecsum(d)/#d >= 8; \\ Michel Marcus, Feb 22 2023
    
  • Python
    def ok(n): d = list(map(int, str(n**2))); return sum(d) >= 8*len(d)
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Feb 22 2023

A360822 Numbers whose squares have at most 2 digits less than 8.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 17, 22, 23, 27, 28, 29, 30, 31, 33, 43, 53, 63, 67, 77, 83, 91, 93, 94, 97, 99, 141, 167, 173, 197, 283, 293, 297, 298, 303, 313, 314, 316, 447, 583, 707, 767, 833, 836, 917, 943, 947, 1378, 2917, 2983, 3033, 5467, 9417, 9433, 29983, 31367, 94863
Offset: 1

Author

Dmitry Kamenetsky, Feb 22 2023

Keywords

Comments

From Michael S. Branicky, Feb 22 2023: (Start)
Conjecture: Sequence has 72 terms, with largest term 940206833.
No terms > 940206833 with less than 17 digits. (End)

Examples

			314641 is in the sequence, because 314641^2 = 98998958881 has only two digits that are less than 8.
		

Crossrefs

Cf. A360803.

Programs

  • Mathematica
    Select[Range[10^5], Count[IntegerDigits[#^2], ?(#1 < 8 &)] < 3 &] (* _Amiram Eldar, Feb 22 2023 *)
  • PARI
    isok(k) = #select(x->(x<8), digits(k^2)) <= 2; \\ Michel Marcus, Feb 22 2023
    
  • Python
    def ok(n): return sum(1 for d in str(n**2) if d < "8") < 3
    print([k for k in range(1, 10**5) if ok(k)]) # Michael S. Branicky, Feb 22 2023
    
  • Python
    # see link for a faster version to find all terms
    
  • Python
    from itertools import count, islice
    def A360822_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:len(s:=str(n**2))<=s.count('8')+s.count('9')+2,count(max(startvalue,1)))
    A360822_list = list(islice(A360822_gen(),62)) # Chai Wah Wu, Mar 11 2023

A350155 a(n) is the greatest number of times that a laser can hit a reflector on an n X n grid (see Comments for precise definition).

Original entry on oeis.org

1, 6, 18, 49, 120, 233
Offset: 1

Author

Dmitry Kamenetsky, Dec 17 2021

Keywords

Comments

The problem is the following.
You are given an empty n X n grid. You can place some reflectors into the cells of the grid.
This arrangement consists of thin flat plates, each of which is rotatably mounted about a vertical axis so that two angular positions relative to the grid axes, namely plus and minus 45 degrees, are possible. A particle is shot into this arrangement and when it hits a reflector, it is deflected by 90 degrees without any loss of momentum according to the reflector's current orientation. After a reflector has been hit by the particle, it rotates by 90 degrees and maintains this position until the next hit. Not every grid position has to be assigned a reflector -- grid positions without reflectors are permitted.

Examples

			See links for examples.
		

Formula

a(n) >= 3*2^n-6, this value can be obtained with a simple pattern (see links above). - Benjamin Butin, Jan 20 2022

Extensions

a(3) corrected and a(4)-a(6) confirmed by Benjamin Butin, Jan 20 2022

A346775 Starting from n!+1, the length of the longest sequence of consecutive numbers which all take the same number of steps to reach 1 in the Collatz (or '3x+1') problem.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 5, 1, 7, 1, 1, 3, 1, 3, 1, 1, 1, 30, 1, 30, 3, 7, 1, 3, 3, 7, 1, 1, 7, 15, 3, 1, 1, 3, 15, 26, 15, 1, 1, 1, 1, 7, 7, 26, 7, 1, 7, 3, 1, 1, 3, 1, 7, 3, 7, 1, 1, 26, 15, 7, 30, 1, 1, 1, 1, 3, 15, 3, 1, 1, 31, 648, 26, 26, 30, 90, 1, 1, 3, 15
Offset: 0

Author

Dmitry Kamenetsky, Aug 03 2021

Keywords

Comments

The largest value known in this sequence is a(219)=78553595.
2^32 < a(238) < 11442739136455298475. - Martin Ehrenstein, Aug 21 2021
Jeremy Sawicki found that a(238) = 107150589645. - Dmitry Kamenetsky, Aug 25 2024

Examples

			a(6) = 3, because 6!+1, 6!+2 and 6!+3 all take 46 steps to reach 1, while 6!+4 requires 20 steps to reach 1.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length[NestWhileList[If[EvenQ@#, #/2, 3 # + 1] &, n, # != 1 &]] - 1; Table[k = 1; While[f[n! + k] == f[n! + k + 1], k++]; k, {n, 0, 100}] (* Bence BernĂ¡th, Aug 14 2021 *)
  • PARI
    a6577(n0)={my(n=n0,k=0);while(n>1,k++;n=if(n%2,3*n+1,n/2));k};
    for(n=0,80,my(n0=n!+1,nc=a6577(n0),k=1);while(a6577(n0++)==nc,k++);print1(k,", ")) \\ Hugo Pfoertner, Aug 04 2021

A344719 Minimum number of cells in an n X n grid that need to be painted so that each unpainted cell is orthogonally adjacent to exactly two painted cells.

Original entry on oeis.org

1, 2, 5, 8, 11, 17, 21, 28, 35, 42, 51, 60, 69, 80, 91
Offset: 1

Author

Dmitry Kamenetsky, May 28 2021

Keywords

Crossrefs

Cf. A344301.

Extensions

a(12)-a(15) from Bert Dobbelaere, Jun 13 2021

A344301 Minimum number of cells in an n X n grid that need to be painted so that each unpainted cell is orthogonally adjacent to exactly one painted cell.

Original entry on oeis.org

1, 2, 3, 4, 8, 12, 15, 16, 24, 28, 35, 36, 48, 54, 63, 64, 77, 88, 96, 100, 117, 130, 140, 144
Offset: 1

Author

Dmitry Kamenetsky, May 14 2021

Keywords

Extensions

a(11)-a(20) from Bert Dobbelaere, Jun 13 2021
a(21)-a(24) from Bert Dobbelaere, Jun 19 2021

A341100 Minimum number of base-2 rectangles needed to tile an n X n square.

Original entry on oeis.org

1, 1, 4, 1, 4, 4, 9, 1, 4, 4, 9, 4, 9, 9, 13, 1, 4, 4, 9, 4, 9, 9, 15, 4, 9, 9, 16, 9, 16, 13, 17, 1, 4, 4, 9, 4, 9, 9, 16, 4, 9, 9, 16, 9, 16, 15, 19, 4, 9, 9, 16, 9, 16, 16, 20, 9, 16, 16, 20, 13, 20, 17, 21
Offset: 1

Author

Dmitry Kamenetsky, Feb 05 2021

Keywords

Comments

A base-2 rectangle is a rectangle whose dimensions are a power of 2.

Examples

			A 5 X 5 square can be covered with 4 such rectangles and this is the minimum, so a(5) = 4. Here is a possible covering:
  1 1 1 1 2
  1 1 1 1 2
  1 1 1 1 2
  1 1 1 1 2
  3 3 3 3 4
n=15 is the smallest n where a(n) < f(n)^2, since a(15) = 13. Here is a possible covering found by Bubbler on Puzzling StackExchange:
  A A A A B B C 1 1 1 1 1 1 1 1
  A A A A B B C 1 1 1 1 1 1 1 1
  A A A A B B C 1 1 1 1 1 1 1 1
  A A A A B B C 1 1 1 1 1 1 1 1
  A A A A B B C 2 2 2 2 2 2 2 2
  A A A A B B C 2 2 2 2 2 2 2 2
  A A A A B B C 3 3 3 3 3 3 3 3
  A A A A B B C 0 X Y Y Z Z Z Z
  7 7 7 7 7 7 7 7 X Y Y Z Z Z Z
  8 8 8 8 8 8 8 8 X Y Y Z Z Z Z
  8 8 8 8 8 8 8 8 X Y Y Z Z Z Z
  9 9 9 9 9 9 9 9 X Y Y Z Z Z Z
  9 9 9 9 9 9 9 9 X Y Y Z Z Z Z
  9 9 9 9 9 9 9 9 X Y Y Z Z Z Z
  9 9 9 9 9 9 9 9 X Y Y Z Z Z Z
		

Crossrefs

Cf. A000120.

Formula

a(n) <= f(n)^2, where f(n) is the number of 1's in the binary representation of n (A000120).
a(n * 2^k) = a(n) for k >= 0.