login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068881 Largest n-digit square with property that digits alternate in parity, or 0 if no such number exists. 2
9, 81, 961, 9216, 96721, 929296, 9690769, 98525476, 987656329, 9618509476, 98987632129, 987650365636, 9890943230169, 98987854141696, 987896383010761, 9896907878105616, 98989096389856929, 989894587654967296, 9898969096969272961, 98985494707696721476 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Giovanni Resta, Table of n, a(n) for n = 1..33

EXAMPLE

a(4) = 9216 as 9, 2, 1, 6 have alternating parity.

MAPLE

alp:= proc(n) local L, d;

L:= convert(n, base, 10);

d:= nops(L);

if d::even then L:= L + map(op, [[0, 1]$(d/2)]) else L:= L + map(op, [[0, 1]$((d-1)/2), [0]]) fi;

nops(convert(L mod 2, set))=1

end proc:f:= proc(d) local s;

  for s from floor(sqrt(10^d)) by -1 to ceil(sqrt(10^(d-1))) do

    if alp(s^2) then return s^2 fi

  od;

  0

end proc:map(f, [$1..10]); # Robert Israel, Aug 14 2018

MATHEMATICA

altQ[n_] := n < 10 || Union[Total /@ Partition[ Mod[ IntegerDigits@ n, 2], 2, 1]] == {1}; a[n_] := Block[{r = Floor@ Sqrt@ FromDigits[8 + Mod[ Range@ n, 2]]}, While[! altQ[r^2], r--]; r^2]; Array[a, 16] (* Giovanni Resta, Aug 17 2018 *)

CROSSREFS

Cf. A068876, A030152, A068880.

Sequence in context: A187122 A113361 A180737 * A104266 A061433 A069659

Adjacent sequences:  A068878 A068879 A068880 * A068882 A068883 A068884

KEYWORD

base,nonn

AUTHOR

Amarnath Murthy, Mar 19 2002

EXTENSIONS

a(5) corrected and more terms from Robert Israel, Aug 14 2018

a(18)-a(20) from Giovanni Resta, Aug 16 2018

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 15 21:38 EDT 2021. Contains 348034 sequences. (Running on oeis4.)