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.

A168588 Smallest p(n)-digit prime with digit sum n, and made up of digits 0 and 1 only, where p(n)=A000040(n) (or 0, if no such prime exists).

Original entry on oeis.org

0, 101, 0, 1011001, 10000110011, 0, 10000000010101111, 1000000000001111111, 0, 10000000000000000101101111101, 1000000000000000000011111110111, 0, 10000000000000000000000000011111111110101, 1000000000000000000000000000110111111011111
Offset: 1

Views

Author

Lekraj Beedassy, Nov 30 2009

Keywords

Comments

a(3n) = 0.

Crossrefs

Programs

  • Maple
    g:= proc(L) local i,m;
      m:= -1;
      for i from 1 do
         if L[i] = 1 then
           if m = -1 then m:= i fi;
           if L[i+1] = 0 then
             return [1$(i-m),0$(m-1),0,1,op(L[i+2..-1])]
           fi
         fi
      od
    end proc:
    f:= proc(n) local L,x,pn,i;
      if n mod 3 = 0 then return 0 fi;
      pn:= ithprime(n);
      L:= [1$(n-1),0$(pn-n),1];
      do
        x:= add(L[i]*10^(i-1),i=1..pn);
        if isprime(x) then return x fi;
        L:= g(L);
      od
    end proc:
    map(f, [$1..16]); # Robert Israel, Feb 01 2021

Extensions

Extended by Ray Chandler, Dec 03 2009