login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 4

%I #44 Mar 09 2024 09:35:54

%S 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 28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,

%U 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 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 This definition comes from Patrick De Geest's link.

%C Other definitions for undulating are present in the OEIS (e.g., A033619, A046075).

%C 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 The definition includes the trivial 1- and 2-digit undulating numbers.

%C Subsequence of A043096 where the first different term is A043096(103) = 123 while a(103) = 130.

%C This sequence first differs from A010784 at a(92) = 101, A010784(92) = 102.

%C The sequence differs from A160542 (which contains 100). - _R. J. Mathar_, Aug 05 2022

%H Patrick De Geest, <a href="http://www.worldofnumbers.com/undulat.htm">Smoothly Undulating Palindromic Primes</a>, World of Numbers.

%e 111 is not a term here, but A033619(102) = 111.

%e a(93) = 102, but 102 is not a term of A046075.

%e Some terms: 5276, 918230, 1053837, 263915847, 3636363636363636.

%e Are not terms: 1331, 594571652, 824327182.

%p isA355301 := proc(n)

%p local dgs,i,back,forw ;

%p dgs := convert(n,base,10) ;

%p if nops(dgs) < 2 then

%p return true;

%p end if;

%p for i from 2 to nops(dgs)-1 do

%p back := op(i,dgs) -op(i-1,dgs) ;

%p forw := op(i+1,dgs) -op(i,dgs) ;

%p if back*forw >= 0 then

%p return false;

%p end if ;

%p end do:

%p back := op(-1,dgs) -op(-2,dgs) ;

%p if back = 0 then

%p return false;

%p end if ;

%p return true ;

%p end proc:

%p A355301 := proc(n)

%p option remember ;

%p if n = 1 then

%p 0;

%p else

%p for a from procname(n-1)+1 do

%p if isA355301(a) then

%p return a;

%p end if;

%p end do:

%p end if;

%p end proc:

%p seq(A355301(n),n=1..110) ; # _R. J. Mathar_, Aug 05 2022

%t q[n_] := AllTrue[(s = Sign[Differences[IntegerDigits[n]]]), # != 0 &] && AllTrue[Differences[s], # != 0 &]; Select[Range[0, 100], q] (* _Amiram Eldar_, Jun 28 2022 *)

%o (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 Cf. A033619, A043096, A046075.

%Y Cf. A059168 (subsequence of primes).

%Y Differs from A010784, A241157, A241158.

%Y Cf. A355302, A355303, A355304.

%K nonn,base

%O 1,3

%A _Bernard Schott_, Jun 27 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 23 02:58 EDT 2024. Contains 374544 sequences. (Running on oeis4.)