login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068626 a(3n) = a(3n-1) = 3*n^2, a(3n-2) = 3*n^2 - 3*n + 1. 5
1, 3, 3, 7, 12, 12, 19, 27, 27, 37, 48, 48, 61, 75, 75, 91, 108, 108, 127, 147, 147, 169, 192, 192, 217, 243, 243, 271, 300, 300, 331, 363, 363, 397, 432, 432, 469, 507, 507, 547, 588, 588, 631, 675, 675, 721, 768, 768, 817, 867, 867, 919, 972, 972, 1027, 1083, 1083, 1141 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
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.
LINKS
FORMULA
From Colin Barker, Feb 18 2020: (Start)
G.f.: x*(1 + 2*x + 2*x^3 + x^4) / ((1 - x)^3*(1 + x + x^2)^2).
a(n) = a(n-1) + 2*a(n-3) - 2*a(n-4) - a(n-6) + a(n-7) for n>7.
(End)
Sum_{n>=1} 1/a(n) = Pi/sqrt(3)*tanh(Pi/(2*sqrt(3))) + Pi^2/9. - Amiram Eldar, Sep 21 2023
MATHEMATICA
LinearRecurrence[{1, 0, 2, -2, 0, -1, 1}, {1, 3, 3, 7, 12, 12, 19}, 60] (* Harvey P. Dale, Jun 29 2022 *)
PROG
(Perl)
my @a = (1); for (my $n = 1; $n <= 90000; $n ++) {
$a[$n] = $a[$n - 1] + ($a[$n - 1] % $n != 0 ? $n : 0);
print "$n $a[$n]\n";
} # Georg Fischer Feb 18 2020
(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
(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
CROSSREFS
Cf. A091684 (first differences).
Sequence in context: A161815 A006661 A343752 * A126698 A219211 A088859
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Feb 26 2002
EXTENSIONS
Entry revised by N. J. A. Sloane, Mar 13 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 13:34 EDT 2024. Contains 371971 sequences. (Running on oeis4.)