Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #26 Feb 27 2023 04:00:28
%S 7,13,27,33,47,53,67,73,87,93,107,113,127,133,147,153,167,173,187,193,
%T 207,213,227,233,247,253,267,273,287,293,307,313,327,333,347,353,367,
%U 373,387,393,407,413,427,433,447,453,467,473,487,493,507,513,527,533
%N Numbers k such that k and 3^k end with the same digit.
%C Also numbers k such that k^k ends with 3. - _Bruno Berselli_, Dec 11 2018
%C Numbers congruent to {7, 13} mod 20. - _Amiram Eldar_, Feb 27 2023
%H Colin Barker, <a href="/A067870/b067870.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F a(2*n+1) = 20*n-13, a(2*n) = 20*n-7.
%F a(n) = 20*(n-1)-a(n-1) for n>1, a(1)=7. - _Vincenzo Librandi_, Aug 08 2010
%F From _Colin Barker_, Apr 06 2020: (Start)
%F G.f.: x*(7 + 6*x + 7*x^2) / ((1 - x)^2*(1 + x)).
%F a(n) = -5 - 2*(-1)^n + 10*n for n>0.
%F a(n) = a(n-1) + a(n-2) - a(n-3) for n>3. (End)
%F Sum_{n>=1} (-1)^(n+1)/a(n) = tan(3*Pi/20)*Pi/20. - _Amiram Eldar_, Feb 27 2023
%e 3^13 = 1594323 hence 13 is in the sequence.
%t LinearRecurrence[{1, 1, -1}, {7, 13, 27}, 50] (* _Amiram Eldar_, Feb 27 2023 *)
%o (PARI) a(n) = (5*(2*n-1)*(-1)^n - 2)*(-1)^n; \\ _Jinyuan Wang_, Apr 06 2020
%o (PARI) Vec(x*(7 + 6*x + 7*x^2) / ((1 - x)^2*(1 + x)) + O(x^50)) \\ _Colin Barker_, Apr 06 2020
%K nonn,base,easy
%O 1,1
%A _Benoit Cloitre_, Mar 07 2002