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 A068626 #34 Sep 21 2023 01:45:18 %S A068626 1,3,3,7,12,12,19,27,27,37,48,48,61,75,75,91,108,108,127,147,147,169, %T A068626 192,192,217,243,243,271,300,300,331,363,363,397,432,432,469,507,507, %U A068626 547,588,588,631,675,675,721,768,768,817,867,867,919,972,972,1027,1083,1083,1141 %N A068626 a(3n) = a(3n-1) = 3*n^2, a(3n-2) = 3*n^2 - 3*n + 1. %C A068626 Or, a(1) = 1, a(n) = n + a(n-1) if n does not divide a(n-1) else a(n) = a(n-1). E.g. a(6) = a(5) = 12 as 6 divides 12. a(10) = 10+a(9) = 10+27 = 37. %H A068626 B. D. Swan, <a href="/A068626/b068626.txt">Table of n, a(n) for n = 1..90000</a> %H A068626 <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,2,-2,0,-1,1). %F A068626 From _Colin Barker_, Feb 18 2020: (Start) %F A068626 G.f.: x*(1 + 2*x + 2*x^3 + x^4) / ((1 - x)^3*(1 + x + x^2)^2). %F A068626 a(n) = a(n-1) + 2*a(n-3) - 2*a(n-4) - a(n-6) + a(n-7) for n>7. %F A068626 (End) %F A068626 Sum_{n>=1} 1/a(n) = Pi/sqrt(3)*tanh(Pi/(2*sqrt(3))) + Pi^2/9. - _Amiram Eldar_, Sep 21 2023 %t A068626 LinearRecurrence[{1,0,2,-2,0,-1,1},{1,3,3,7,12,12,19},60] (* _Harvey P. Dale_, Jun 29 2022 *) %o A068626 (Perl) %o A068626 my @a = (1); for (my $n = 1; $n <= 90000; $n ++) { %o A068626 $a[$n] = $a[$n - 1] + ($a[$n - 1] % $n != 0 ? $n : 0); %o A068626 print "$n $a[$n]\n"; %o A068626 } # _Georg Fischer_ Feb 18 2020 %o A068626 (Magma) [(n mod 3 eq 1) select (n+2)^2/3 - n-1 else (n+((n mod 3)^2) mod 3 )^2/3 : n in [1..50]]; // _Marius A. Burtea_, Feb 19 2020 %o A068626 (PARI) Vec(x*(1 + 2*x + 2*x^3 + x^4) / ((1 - x)^3*(1 + x + x^2)^2) + O(x^50)) \\ _Colin Barker_, Feb 19 2020 %Y A068626 Cf. A091684 (first differences). %K A068626 easy,nonn %O A068626 1,2 %A A068626 _Amarnath Murthy_, Feb 26 2002 %E A068626 Entry revised by _N. J. A. Sloane_, Mar 13 2006