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.
%I A378505 #52 Aug 17 2025 02:04:46 %S A378505 0,1,3,0,4,9,15,22,30,39,49,60,0,13,27,42,58,75,93,112,132,153,175, %T A378505 198,222,247,273,300,328,357,387,418,450,483,517,552,588,625,663,0,40, %U A378505 81,123,166,210,255,301,348,396,445,495,546,598,651,705,760,816 %N A378505 a(0) = 0, a(n) = 0 where a(n-1) is nonzero and divisible by n. Otherwise a(n) = n + a(n-1). %C A378505 From _Robert Israel_, Nov 29 2024: (Start) %C A378505 There are an infinite number of zeros in the sequence. If not, suppose a(m) was the last one. Then for j > m, we would have a(j-1) = (m+1) + (m+2) + ... + (j-1) = (j+m)*(j-m-1)/2. In particular, a(m*(m+1)-1) = (m-1)*m*(m+1)*(m+2)/2, which is divisible by m*(m+1) since m-1 or m+2 is even, and that would mean a(m*(m+1)) = 0, contradiction. (End) %C A378505 From _David A. Corneth_, Nov 30 2024: (Start) %C A378505 For some z_0 > 0 such that a(z_0) = 0 we can find the next z_1 > z_0 such that a(z_1) = 0 but for any z_0 < t < z_1 we have a(t) > 0. Then a(t) = binomial(t+1, 2) - binomial(z0+1, 2). Since a(z_1) = 0 we have z_1 | (binomial(z_1 -1 +1, 2) - binomial(z0+1, 2)) = z_1 * (z_1 - 1) / 2 - z_0 * (z_0 + 1)/2. %C A378505 This means z_1 | 2*(z_1 * (z_1 - 1) / 2 - z_0 * (z_0 + 1)/2) = (z_1 * (z_1 - 1) - z_0 * (z_0 + 1)) where (z_1 * (z_1 - 1) - z_0 * (z_0 + 1)) > 0. As z_1 | z_1 * (z_1 - 1) we also have z_1 | (z_0 * (z_0 + 1)). By the proof of _Robert Israel_ above such z_1 must exist. (End) %H A378505 Paolo Xausa, <a href="/A378505/b378505.txt">Table of n, a(n) for n = 0..10000</a> %H A378505 David A. Corneth, <a href="/A378505/a378505.gp.txt">PARI programs</a> %H A378505 Michael De Vlieger, <a href="/A378505/a378505.png">Log log scatterplot of a(n)</a>, n = 1..2^20, showing a(n) = 0 instead as 1/2 for visibility. %e A378505 a(11) = 49 + 11 = 60, since a(10) = 49, which does not exactly divide by 11. %e A378505 a(12) = 0, since a(11) = 60, a nonzero number that exactly divides by 12. %e A378505 a(13) = 0 + 13 = 13, since a(12) = 0 (so is not nonzero). %e A378505 From _David A. Corneth_, Nov 30 2024: (Start) %e A378505 The next 0 after n = 12 is a divisor of 12 * (12 + 1) = 156. The divisors of 156 that are larger than 12 + 1 = 13 are 26, 39, 52, 78, 156. Of these, 39 is the smallest z_1 such that z_1 | z_1 * (z_1 - 1) / 2 - z_0 * (z_0 + 1)/2. Therefore the next 0 after n = 12 is at n = 39. %e A378505 The first few zeros are at 0, 3, 12, 39, 65, 78, 158, 237, ... (= A379013). As 100 is between the consecutive zeros 78 and 158 there is no zero strictly between 78 and 158 and so a(100) = 100*(100+1) / 2 - 78*(78+1)/2 = 1969. (End) %p A378505 a:= proc(n) option remember; `if`(n=0, 0, (t-> %p A378505 `if`(t>0 and irem(t,n)=0, 0, t+n))(a(n-1))) %p A378505 end: %p A378505 seq(a(n), n=0..56); # _Alois P. Heinz_, Nov 29 2024 %t A378505 Module[{n = 0}, NestList[If[Divisible[#, ++n] && # > 0, 0, # + n] &, 0, 100]] (* _Paolo Xausa_, Dec 09 2024 *) %o A378505 (Python) %o A378505 from itertools import count, islice %o A378505 def agen(): # generator of terms %o A378505 an = 0 %o A378505 for n in count(1): %o A378505 yield an %o A378505 an = 0 if an > 0 and an%n == 0 else an + n %o A378505 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Nov 29 2024 %o A378505 (PARI) \\ See Corneth link %Y A378505 Cf. A068627, A379013 (positions of zeros). %K A378505 nonn,easy,look %O A378505 0,3 %A A378505 _Stuart Coe_, Nov 29 2024