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.

A335842 Nonnegative differences of positive cubes and positive tetrahedral numbers.

This page as a plain text file.
%I A335842 #20 Aug 17 2020 23:17:47
%S A335842 0,1,4,5,7,8,17,23,26,29,31,36,41,44,49,51,54,57,60,63,68,69,77,83,90,
%T A335842 93,96,99,105,115,121,122,123,124,132,144,148,149,151,160,169,173,178,
%U A335842 180,181,184,188,191,196,206,211,212,215,223,226,230,258,259,274
%N A335842 Nonnegative differences of positive cubes and positive tetrahedral numbers.
%C A335842 The sequence is the difference between the cubic number (A000578) and the tetrahedral number (A000292) such that terms are of the form A000578(i) - A000292(j), where A000578(i) >= A000292(j) >= 0.
%C A335842 It appears that, for a(n) > 456, the number of terms up to a(n) in this sequence is smaller than the number of prime numbers less than or equal to a(n), or n < pi(a(n)), where pi is the prime counting function. See the figure attached in the Links section.
%H A335842 Ya-Ping Lu, <a href="/A335842/a335842.pdf">The number of terms up to a(n) and the number of prime numbers less than or equal to a(n)</a>
%F A335842 The difference between the i-th cubic number, c(i), and j-th tetrahedral number, t(j), is d = i^3 - j*(j+1)*(j+2)/6, where i, j >=1 and c(i) >= t(j).
%e A335842 a(1)=0 because c(1)-t(1) = 1-1 = 0;
%e A335842 a(2)=1 because c(11)-t(19) = 1331-1330 = 1;
%e A335842 a(5)=7 because c(2)-t(1) = 8-1 = 7, and c(3)-t(4) = 27-20 = 7;
%e A335842 a(18)=57 because c(7)-t(11) = 343-286 = 57, and c(8)-t(13) = 512-455 = 57;
%e A335842 a(26)=93 because c(2313)-t(4202) = 12374478297-12374478204 = 93.
%o A335842 (Python)
%o A335842 import math
%o A335842 n_max = 10000000
%o A335842 d_max = 10000
%o A335842 list1 = []
%o A335842 n = 1
%o A335842 while n <= n_max:
%o A335842   a_tetr = n*(n + 1)*(n + 2)//6
%o A335842   m_min = math.floor(math.pow(a_tetr, 1/3))
%o A335842   m = m_min
%o A335842   a_cube_max = n*(n + 1)*(n + 2)//6 + d_max
%o A335842   m_max = math.ceil(math.pow(a_cube_max, 1/3))
%o A335842   while m <= m_max:
%o A335842       a_cube = m**3
%o A335842       d = a_cube - a_tetr
%o A335842       if d >= 0 and d <= d_max and d not in list1:
%o A335842           list1.append(d)
%o A335842       m += 1
%o A335842   n += 1
%o A335842 list1.sort()
%o A335842 print(list1)
%Y A335842 Cf. A000292, A000578, A175034, A175035, A335761.
%K A335842 nonn
%O A335842 1,3
%A A335842 _Ya-Ping Lu_, Jun 26 2020