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.

A178796 An ascending sequence of primes a(n) such that either the sum of decimal digits of a(n) is divisible by the sum of decimal digits of a(n+1) or vice versa.

This page as a plain text file.
%I A178796 #7 Feb 23 2019 22:11:31
%S A178796 2,11,13,17,31,53,71,79,97,101,103,107,211,233,251,277,349,367,431,
%T A178796 439,457,503,521,547,619,673,691,701,709,727,853,907,1021,1061,1069,
%U A178796 1087,1151,1201,1223,1249,1429,1447,1483,1511,1601,1609,1627,1663,1753,1861,1933,1951,2011,2099
%N A178796 An ascending sequence of primes a(n) such that either the sum of decimal digits of a(n) is divisible by the sum of decimal digits of a(n+1) or vice versa.
%H A178796 Harvey P. Dale, <a href="/A178796/b178796.txt">Table of n, a(n) for n = 1..1000</a>
%e A178796 The sums of the digits of a(n) form the sequence d(n) = 2, 2, 4, 8, 4, 8, 8, 16, ... in which either d(n)/d(n+1) or d(n+1)/d(n) is an integer.
%p A178796 A178796 := proc(n) option remember; if n = 1 then 2; else a := nextprime(procname(n-1)) ; while true do r := A007953(a)/ A007953(procname(n-1)) ; if numer(r) = 1 or denom(r) = 1 then return a; end if; a := nextprime(a) ; end do: end if; end proc:
%p A178796 seq(A178796(n),n=1..80) ; # _R. J. Mathar_, Jun 28 2010
%t A178796 nxt[n_]:=Module[{k=NextPrime[n],tidn=Total[IntegerDigits[n]]},While[ !Divisible[ Total[ IntegerDigits[ k]],tidn] && !Divisible[ tidn,Total[ IntegerDigits[k]]],k=NextPrime[k]];k]; NestList[nxt,2,60] (* _Harvey P. Dale_, Aug 23 2017 *)
%Y A178796 Different from A068807.
%K A178796 base,nonn
%O A178796 1,1
%A A178796 _Giovanni Teofilatto_, Jun 15 2010
%E A178796 Corrected by _Giovanni Teofilatto_, Jun 25 2010
%E A178796 Definition corrected, sequence extended, example added by _R. J. Mathar_, Jun 28 2010