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.

A355301 Normal undulating numbers where "undulating" means that the alternate digits go up and down (or down and up) and "normal" means that the absolute differences between two adjacent digits may differ.

This page as a plain text file.
%I A355301 #44 Mar 09 2024 09:35:54
%S A355301 0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,
%T A355301 28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,
%U A355301 53,54,56,57,58,59,60,61,62,63,64,65,67,68,69,70,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,101,102,103,104,105,106,107,108,109,120,121,130,131,132,140,141,142,143,150
%N A355301 Normal undulating numbers where "undulating" means that the alternate digits go up and down (or down and up) and "normal" means that the absolute differences between two adjacent digits may differ.
%C A355301 This definition comes from Patrick De Geest's link.
%C A355301 Other definitions for undulating are present in the OEIS (e.g., A033619, A046075).
%C A355301 When the absolute differences between two adjacent digits are always equal (e.g., 85858), these numbers are called smoothly undulating numbers and form a subsequence (A046075).
%C A355301 The definition includes the trivial 1- and 2-digit undulating numbers.
%C A355301 Subsequence of A043096 where the first different term is A043096(103) = 123 while a(103) = 130.
%C A355301 This sequence first differs from A010784 at a(92) = 101, A010784(92) = 102.
%C A355301 The sequence differs from A160542 (which contains 100). - _R. J. Mathar_, Aug 05 2022
%H A355301 Patrick De Geest, <a href="http://www.worldofnumbers.com/undulat.htm">Smoothly Undulating Palindromic Primes</a>, World of Numbers.
%e A355301 111 is not a term here, but A033619(102) = 111.
%e A355301 a(93) = 102, but 102 is not a term of A046075.
%e A355301 Some terms: 5276, 918230, 1053837, 263915847, 3636363636363636.
%e A355301 Are not terms: 1331, 594571652, 824327182.
%p A355301 isA355301 := proc(n)
%p A355301     local dgs,i,back,forw ;
%p A355301     dgs := convert(n,base,10) ;
%p A355301     if nops(dgs) < 2 then
%p A355301         return true;
%p A355301     end if;
%p A355301     for i from 2 to nops(dgs)-1 do
%p A355301         back := op(i,dgs) -op(i-1,dgs) ;
%p A355301         forw := op(i+1,dgs) -op(i,dgs) ;
%p A355301         if back*forw >= 0 then
%p A355301             return false;
%p A355301         end if ;
%p A355301     end do:
%p A355301     back := op(-1,dgs) -op(-2,dgs) ;
%p A355301     if back = 0 then
%p A355301         return false;
%p A355301     end if ;
%p A355301     return true ;
%p A355301 end proc:
%p A355301 A355301 := proc(n)
%p A355301     option remember ;
%p A355301     if n = 1 then
%p A355301         0;
%p A355301     else
%p A355301         for a from procname(n-1)+1 do
%p A355301             if isA355301(a) then
%p A355301                 return a;
%p A355301             end if;
%p A355301         end do:
%p A355301     end if;
%p A355301 end proc:
%p A355301 seq(A355301(n),n=1..110) ; # _R. J. Mathar_, Aug 05 2022
%t A355301 q[n_] := AllTrue[(s = Sign[Differences[IntegerDigits[n]]]), # != 0 &] && AllTrue[Differences[s], # != 0 &]; Select[Range[0, 100], q] (* _Amiram Eldar_, Jun 28 2022 *)
%o A355301 (PARI) isok(m) = if (m<10, return(1)); my(d=digits(m), dd = vector(#d-1, k, sign(d[k+1]-d[k]))); if (#select(x->(x==0), dd), return(0)); my(pdd = vector(#dd-1, k, dd[k+1]*dd[k])); #select(x->(x>0), pdd) == 0; \\ _Michel Marcus_, Jun 30 2022
%Y A355301 Cf. A033619, A043096, A046075.
%Y A355301 Cf. A059168 (subsequence of primes).
%Y A355301 Differs from A010784, A241157, A241158.
%Y A355301 Cf. A355302, A355303, A355304.
%K A355301 nonn,base
%O A355301 1,3
%A A355301 _Bernard Schott_, Jun 27 2022