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

%I #34 Sep 21 2023 01:45:18

%S 1,3,3,7,12,12,19,27,27,37,48,48,61,75,75,91,108,108,127,147,147,169,

%T 192,192,217,243,243,271,300,300,331,363,363,397,432,432,469,507,507,

%U 547,588,588,631,675,675,721,768,768,817,867,867,919,972,972,1027,1083,1083,1141

%N a(3n) = a(3n-1) = 3*n^2, a(3n-2) = 3*n^2 - 3*n + 1.

%C 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 B. D. Swan, <a href="/A068626/b068626.txt">Table of n, a(n) for n = 1..90000</a>

%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,2,-2,0,-1,1).

%F From _Colin Barker_, Feb 18 2020: (Start)

%F G.f.: x*(1 + 2*x + 2*x^3 + x^4) / ((1 - x)^3*(1 + x + x^2)^2).

%F a(n) = a(n-1) + 2*a(n-3) - 2*a(n-4) - a(n-6) + a(n-7) for n>7.

%F (End)

%F Sum_{n>=1} 1/a(n) = Pi/sqrt(3)*tanh(Pi/(2*sqrt(3))) + Pi^2/9. - _Amiram Eldar_, Sep 21 2023

%t LinearRecurrence[{1,0,2,-2,0,-1,1},{1,3,3,7,12,12,19},60] (* _Harvey P. Dale_, Jun 29 2022 *)

%o (Perl)

%o my @a = (1); for (my $n = 1; $n <= 90000; $n ++) {

%o $a[$n] = $a[$n - 1] + ($a[$n - 1] % $n != 0 ? $n : 0);

%o print "$n $a[$n]\n";

%o } # _Georg Fischer_ Feb 18 2020

%o (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 (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 Cf. A091684 (first differences).

%K easy,nonn

%O 1,2

%A _Amarnath Murthy_, Feb 26 2002

%E Entry revised by _N. J. A. Sloane_, Mar 13 2006

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 May 5 14:32 EDT 2024. Contains 372275 sequences. (Running on oeis4.)