%I #51 Sep 08 2022 08:45:17
%S 7,1,3,7,15,31,63,127,247,493,983,1959,3903,7775,15487,30847,61447,
%T 122401,243819,485679,967455,1927135,3838783,7646719,15231991,
%U 30341581,60439343,120393007,239818559,477709983,951581183,1895515647,3775799303,7521257025
%N Heptanacci-Lucas numbers.
%C This 7th-order linear recurrence is a generalization of the Lucas sequence A000032. Mario Catalani would refer to this is a generalized heptanacci sequence, had he not stopped his series of sequences after A001644 "generalized tribonacci", A073817 "generalized tetranacci", A074048 "generalized pentanacci", A074584 "generalized hexanacci." _T. D. Noe_ and I have noted that each of these has many more primes than the corresponding tribonacci A000073 (see A104576), tetranacci A000288 (see A104577), pentanacci, hexanacci and heptanacci (see A104414). For primes in Heptanacci-Lucas numbers, see A104622. For semiprimes in Heptanacci-Lucas numbers, see A104623.
%H G. C. Greubel, <a href="/A104621/b104621.txt">Table of n, a(n) for n = 0..3300</a> (terms 0..200 from T. D. Noe)
%H Martin Burtscher, Igor Szczyrba, RafaĆ Szczyrba, <a href="https://www.emis.de/journals/JIS/VOL18/Szczyrba/sz3.html">Analytic Representations of the n-anacci Constants and Generalizations Thereof</a>, Journal of Integer Sequences, Vol. 18 (2015), Article 15.4.5.
%H Mario Catalani, <a href="http://arxiv.org/abs/math/0210201">Polymatrix and Generalized Polynacci Numbers</a>, arXiv:math/0210201 [math.CO], 2002.
%H C. A. Charalambides, <a href="http://www.fq.math.ca/Scanned/29-4/charalambides.pdf">Lucas numbers and polynomials of order k and the length of the longest circular success run</a>, The Fibonacci Quarterly, 29 (1991), 290-297.
%H Spiros D. Dafnis, Andreas N. Philippou, Ioannis E. Livieris, <a href="https://doi.org/10.3390/math8091487">An Alternating Sum of Fibonacci and Lucas Numbers of Order k</a>, Mathematics (2020) Vol. 9, 1487.
%H Tony D. Noe and Jonathan Vos Post, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL8/Noe/noe5.html">Primes in Fibonacci n-step and Lucas n-step Sequences,</a> J. of Integer Sequences, Vol. 8 (2005), Article 05.4.4
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,1,1,1,1,1).
%F a(n) = a(n-1) + a(n-2) + a(n-3) + a(n-4) + a(n-5) + a(n-6) + a(n-7); a(0) = 7, a(1) = 1, a(2) = 3, a(3) = 7, a(4) = 15, a(5) = 31, a(6) = 63.
%F From _R. J. Mathar_, Nov 16 2007: (Start)
%F G.f.: (7 - 6*x - 5*x^2 - 4*x^3 - 3*x^4 - 2*x^5 - x^6)/(1 - x - x^2 - x^3 - x^4 - x^5 - x^6 - x^7).
%F a(n) = 7*A066178(n) - 6*A066178(n-1) - 5*A066178(n-2) - ... - 2*A066178(n-5) - A066178(n-6) if n >= 6. (End)
%p A104621 := proc(n)
%p option remember;
%p if n <=6 then
%p op(n+1,[7, 1, 3, 7, 15, 31, 63])
%p else
%p add(procname(n-i),i=1..7) ;
%p end if;
%p end proc: # _R. J. Mathar_, Mar 26 2015
%t a[0]=7; a[1]=1; a[2]=3; a[3]=7; a[4]=15; a[5]=31; a[6]=63; a[n_]:= a[n]= a[n-1]+a[n-2]+a[n-3]+a[n-4]+a[n-5]+a[n-6]+a[n-7]; Table[a[n], {n,0,40}] (* _Robert G. Wilson v_, Mar 17 2005 *)
%t LinearRecurrence[{1, 1, 1, 1, 1, 1, 1}, {7, 1, 3, 7, 15, 31, 63}, 40] (* _Vladimir Joseph Stephan Orlovsky_, Feb 08 2012 *)
%o (PARI) my(x='x+O('x^40)); Vec((-7+6*x+5*x^2+4*x^3+3*x^4+2*x^5+x^6)/(-1+x +x^2+x^3+x^4+x^5+x^6+x^7)) \\ _G. C. Greubel_, Dec 18 2017
%o (PARI) polsym(polrecip(1-x-x^2-x^3-x^4-x^5-x^6-x^7), 40) \\ _G. C. Greubel_, Apr 22 2019
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (-7+6*x+ 5*x^2+4*x^3+3*x^4+2*x^5+x^6)/(-1+x +x^2+x^3+x^4+x^5+x^6+x^7) )); // _G. C. Greubel_, Apr 22 2019
%o (Sage) ((-7+6*x+5*x^2+4*x^3+3*x^4+2*x^5+x^6)/(-1+x +x^2+x^3+x^4+x^5+x^6 +x^7)).series(x, 41).coefficients(x, sparse=False) # _G. C. Greubel_, Apr 22 2019
%Y Cf. A000032, A001644, A073817, A074048, A074584, A104414, A104576, A104577.
%K easy,nonn
%O 0,1
%A _Jonathan Vos Post_, Mar 17 2005