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.
%I A302552 #37 Oct 30 2020 15:39:08 %S A302552 5,5,5,3,4,7,5,8,10,11,7,8,6,9,7,10,11,8,9,5,8,9,12,13,9,10,13,11,14, %T A302552 9,10,9,10,13,12,9,10,13,11,10,11,11,10,13,11,14,9,15,13,16,15,16,11, %U A302552 12,13,16,17,10,11,14,17,16,14,9,12,10,12,13,12,15,15 %N A302552 Number of segments needed to display the n-th prime number on a 7-segment LCD display. %C A302552 _ _ _ _ _ _ _ _ %C A302552 | | | _| _| |_| |_ |_ | |_| |_| %C A302552 |_| | |_ _| | _| |_| | |_| _| %C A302552 . %H A302552 <a href="/index/Ca#calculatordisplay">Index entries for sequences related to calculator display</a> %F A302552 a(n) = A006942(A000040(n)). - _Alois P. Heinz_, Jun 20 2018 %e A302552 For n = 6, prime(6) = 13, which has two digits: 1, 3. We need two segments for the 1 and five for the 3 (see the Comments section), so a(6) = 2 + 5 = 7. %p A302552 a:= n-> add([6,2,5,5,4,5,6,3,7,6][i+1], i=convert(ithprime(n), base, 10)): %p A302552 seq(a(n), n=1..100); # _Alois P. Heinz_, Jun 20 2018 %t A302552 f[n_] := Plus @@ (IntegerDigits@n /. {0 -> 6, 1 -> 2, 2 -> 5, 3 -> 5, 7 -> 3, 8 -> 7, 9 -> 6}); f@# & /@ Prime@ Range@ 71 (* _Robert G. Wilson v_, Jun 20 2018 *) %o A302552 (PARI) { %o A302552 v=vector(10); %o A302552 v[1]=6;v[2]=2;v[3]=5;v[4]=5;v[5]=4;v[6]=5;v[7]=6;v[8]=3;v[9]=7;v[10]=6; %o A302552 forprime(n=2,1000, %o A302552 d=digits(n,10);s=0; %o A302552 for(i=1,#d, %o A302552 s+=v[d[i]+1]; %o A302552 ) %o A302552 ;print1(s", ") %o A302552 ) %o A302552 } %o A302552 (Python) %o A302552 from sympy import prime %o A302552 def A302552(n): %o A302552 return sum((6, 2, 5, 5, 4, 5, 6, 3, 7, 6)[int(d)] for d in str(prime(n))) # _Chai Wah Wu_, Oct 30 2020 %Y A302552 Cf. A000040, A006942. %K A302552 nonn,easy,base %O A302552 1,1 %A A302552 _Dimitris Valianatos_, Jun 20 2018