cp's OEIS Frontend

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.

A143164 Numbers with digitsum 13, in increasing order.

This page as a plain text file.
%I A143164 #45 Feb 16 2025 08:33:08
%S A143164 49,58,67,76,85,94,139,148,157,166,175,184,193,229,238,247,256,265,
%T A143164 274,283,292,319,328,337,346,355,364,373,382,391,409,418,427,436,445,
%U A143164 454,463,472,481,490,508,517,526,535,544,553,562,571,580,607,616,625,634,643,652
%N A143164 Numbers with digitsum 13, in increasing order.
%C A143164 If 13 is considered as an 'unlucky' number: the 'unlucky years'.
%C A143164 A007953(a(n)) = 13; number of repdigits = A242627(13) = 1. - _Reinhard Zumkeller_, Jul 17 2014
%D A143164 The Guardian Weekly, July 25-31, 2008, p.39 puzzles 5., p31.
%H A143164 David A. Corneth, <a href="/A143164/b143164.txt">Table of n, a(n) for n = 1..10000</a>
%H A143164 Wolfdieter Lang, <a href="/A143164/a143164.txt">a(n) up to 3000</a>
%H A143164 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Triskaidekaphobia.html">Triskaidekaphobia</a>
%H A143164 Wikipedia, <a href="http://en.wikipedia.org/wiki/Triskaidekaphobia">Triskaidekaphobia</a>
%F A143164 digitsum(a(n))=13, ordered increasingly.
%e A143164 2029 is the next 'unlucky year'. Solution to the guardian weekly puzzle.
%e A143164 a(10^ 1) = 166
%e A143164 a(10^ 2) = 1309
%e A143164 a(10^ 3) = 21370
%e A143164 a(10^ 4) = 1100254
%e A143164 a(10^ 5) = 111032122
%e A143164 a(10^ 6) = 30611101000
%e A143164 a(10^ 7) = 40100300100301
%e A143164 a(10^ 8) = 200011001012211010
%e A143164 a(10^ 9) = 10001220000100012002100
%e A143164 a(10^10) = 1100000001010021010000000230 - _David A. Corneth_, Jan 31 2015
%t A143164 f[n_] := Rest@ Select[Range@ n, NestWhile[Plus @@ IntegerDigits[#] &, #, # > 14 &] == 13 &]; f@ 652 (* _Michael De Vlieger_, Feb 03 2015 *)
%t A143164 Select[Range[700],Total[IntegerDigits[#]]==13&] (* _Harvey P. Dale_, Oct 11 2017 *)
%o A143164 (Haskell)
%o A143164 a143164 n = a143164_list !! (n-1)
%o A143164 a143164_list = filter ((== 13) . a007953) [0..]
%o A143164 -- _Reinhard Zumkeller_, Jul 17 2014
%o A143164 (PARI)
%o A143164 \\This algorithm needs a modified binomial.
%o A143164 C(n,k)=if(n>=k,binomial(n,k),0)
%o A143164 \\ways to roll s-q with q dice having sides 0 through n - 1.
%o A143164 b(s,q,n)=if(s<=q*(n-1),s+=q;sum(i=0,q-1,(-1)^i*C(q,i)*C(s-1-n*i,q-1)),0)
%o A143164 \\main algorithm
%o A143164 a(n) = {my(q); q = 2; while(b(13, q, 10) < n, q++); q--; s = 13; os = 13; r=0; while(q, if(b(s,q,10) < n, n-=b(s,q,10);s--, r+=(os-s)*10^(q); os = s; q--)); r+= s;r}
%o A143164 \\inverse
%o A143164 inv(n)={r = 1; v=digits(n); l=v[#v]; forstep(i = #v-1, 1, -1, for(j=1, v[i], r+=b(l+j, #v-i, 10)); l+=v[i]); r} \\ _David A. Corneth_, Jan 31 2015
%o A143164 (PARI) transform(n,b)=my(d=digits(n),nd=#d,v=vector(b,i,[i\10,b-(b+1-i)\10]),k); v[b][2]=d[1]; v
%o A143164 list(lim)=my(v=List(),d=transform(lim\=1,13)); forvec(u=transform(lim\1,13), if(u[4]<u[10] || (u[1]<u[10] && u[2]<u[11] && u[3]<u[12] && u[4]<u[13]), my(s=sum(i=1,13,10^u[i])); if(s<=lim, listput(v, s))),1); Set(v) \\ _Charles R Greathouse IV_, May 30 2019
%Y A143164 Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).
%Y A143164 Cf. A242614, A242627.
%K A143164 nonn,base,easy
%O A143164 1,1
%A A143164 _Wolfdieter Lang_, Sep 15 2008