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.

A158085 Starting at a(1)=2, a(n) is the smallest prime larger than a(n-1) such that the sum of odd digits of a(n) is not smaller than the sum of odd digits of a(n-1).

This page as a plain text file.
%I A158085 #17 Nov 15 2018 06:59:18
%S A158085 2,3,5,7,17,19,37,59,79,97,179,197,199,379,397,577,599,797,977,997,
%T A158085 1979,1997,1999,5779,7759,7993,9199,9397,9739,9973,13799,13997,13999,
%U A158085 17599,17959,17977,19597,19759,19777,19979
%N A158085 Starting at a(1)=2, a(n) is the smallest prime larger than a(n-1) such that the sum of odd digits of a(n) is not smaller than the sum of odd digits of a(n-1).
%C A158085 "Odd digits" means odd-valued digits (not digits in odd-indexed positions).
%F A158085 A071649(a(n)) >= A071649(a(n-1)). - _R. J. Mathar_, Feb 02 2015
%e A158085 The sequence of the sums of odd digits is 0, 3=3, 5=5, 7=7, 1+7=8, 1+9=10, 3+7=10, 5+9=14, 7+9=16, 9+7=16, 1+7+9=17, 1+9+7=17, 1+9+9=19 and so on. - _R. J. Mathar_, Feb 02 2015
%p A158085 A158085 := proc(n)
%p A158085     option remember;
%p A158085     if n =1 then
%p A158085         2;
%p A158085     else
%p A158085         for a from procname(n-1)+1 do
%p A158085             if isprime(a) then
%p A158085                 if A071649(a) >= A071649(procname(n-1)) then
%p A158085                     return a;
%p A158085                 end if;
%p A158085             end if;
%p A158085         end do:
%p A158085 end if; # _R. J. Mathar_, Feb 02 2015
%t A158085 spl[n_]:=Module[{sod=Total[Select[IntegerDigits[n],OddQ]],p1= NextPrime[ n]}, While[ Total[ Select[ IntegerDigits[ p1],OddQ]]<sod, p1=NextPrime[ p1]]; p1]; NestList[spl,2,40] (* _Harvey P. Dale_, Nov 15 2018 *)
%K A158085 nonn,base,less
%O A158085 1,1
%A A158085 _Juri-Stepan Gerasimov_, Mar 12 2009
%E A158085 Corrected (997 inserted, 1699 removed, 9199 to 9739 inserted) by _R. J. Mathar_, May 19 2010